Access-Launch report from BtnSelect_Click Procedure

How do I launch my report, "Report Report" from within my BtnSelect_Click VBA procedure?
LVL 12
Missus Miss_SellaneusAsked:
Who is Participating?
 
javaftperCommented:

Private Sub BtnSelect_Click()

DoCmd.OpenReport "Report Report", acViewNormal

End sub
0
 
Missus Miss_SellaneusAuthor Commented:
Thats printing the report.  How do I run the report in preview mode?. (as if running by double clicking on the report.)
0
 
Missus Miss_SellaneusAuthor Commented:
found acPreview...


The report preview is opening underneath my form. How do I make it open on top of my form?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeffrey CoachmanMIS LiasonCommented:
Turn off the Modal or Pop-up property of the form...
This is what stops other things form opening on top of it.

Or,...
Depending on your version of Access, you can can try this on the code that opens the report:

DoCmd.OpenReport "YourReportName", acViewPreview
Reports!YourReportName.SetFocus

;-)

JeffCoachman
0
 
Missus Miss_SellaneusAuthor Commented:
I tried this:

DoCmd.OpenReport "Report Report", acPreview
Reports!Report Report.SetFocus

It doesn't like the second line, apparently this is either because there is a space in my report name or because Report is a reserved word. I tried putting Report Report in quotes.

"Modal" is how I was able to make the form not fill the entire screen.  Is there another way to do that?
0
 
Missus Miss_SellaneusAuthor Commented:
Changed Pop-up for the report to "Yes" to make the report open on top of the form.
0
 
Jeffrey CoachmanMIS LiasonCommented:
<Reports!Report Report.SetFocus>
,It doesn't like the second line, apparently this is either because there is a space in my report name >
Yes, please do not use spaces in your object names for this reason, and adopt a standard naming convention:
http://www.xoc.net/standards/default.asp

...but to fix this as is use this:
    Reports![Report Report].SetFocus

;-)

Jeff
0
 
Jeffrey CoachmanMIS LiasonCommented:
How was the first post a solution, when you stated that it did not work?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.