Open a Report by Command button

kplatt

Registered User.
Local time
Today, 17:28
Joined
Aug 26, 2009
Messages
115
Hi, I currently have the following code in an event procedure that by clicking a command button the following happens. the code below opens up a report in Print preview and not the regular report view. How do i change the code so that by clicking the command button, the regular report view (green folder) is opened.

Private Sub Command7_Click()
DoCmd.OpenReport "TRI Chemical Purchases", acViewPreview
End Sub

Thanks
 
If you are using Access 2007 or 2010 (which I assume you are) I believe you would use acViewReportView
 
Well, I was close - it is acViewReport
 
I think i tried that before and i just tried to use it. This goes directly to the printer and prints without opening the form. I want the user to open and view the form. is there another code? Thanks
 
I just randomly tried acViewReport and that seemed to work. Does that make sense? Thanks
 
acViewReport is the correct one. acViewNormal is the one that sends the report directly to the printer without viewing.
 

Users who are viewing this thread

Back
Top Bottom