Solved

Access-Launch report from BtnSelect_Click Procedure

Posted on 2010-08-26
8
445 Views
Last Modified: 2013-11-28
How do I launch my report, "Report Report" from within my BtnSelect_Click VBA procedure?
0
Comment
Question by:Missus Miss_Sellaneus
  • 4
  • 3
8 Comments
 
LVL 4

Accepted Solution

by:
javaftper earned 500 total points
ID: 33535840

Private Sub BtnSelect_Click()

DoCmd.OpenReport "Report Report", acViewNormal

End sub
0
 
LVL 11

Author Comment

by:Missus Miss_Sellaneus
ID: 33535900
Thats printing the report.  How do I run the report in preview mode?. (as if running by double clicking on the report.)
0
 
LVL 11

Author Comment

by:Missus Miss_Sellaneus
ID: 33535943
found acPreview...


The report preview is opening underneath my form. How do I make it open on top of my form?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33536224
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 11

Author Comment

by:Missus Miss_Sellaneus
ID: 33536411
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
 
LVL 11

Author Comment

by:Missus Miss_Sellaneus
ID: 33536857
Changed Pop-up for the report to "Yes" to make the report open on top of the form.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33538491
<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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33538555
How was the first post a solution, when you stated that it did not work?
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now