Report to a printer or preview mode? (1 Viewer)

Gkirkup

Registered User.
Local time
Yesterday, 22:58
Joined
Mar 6, 2007
Messages
628
I have a report which usually prints to a printer, but sometimes we want it to be in preview mode so that we can make a PDF and email it. I don't want to duplicate the report. Is there a way that I can programably select printer or preview mode? The report is actually a packing list used many times a day, so always having it in preview mode and manually selecting a printer is not an option.

Robert
 

June7

AWF VIP
Local time
Yesterday, 21:58
Joined
Mar 9, 2014
Messages
5,466
I do this.

DoCmd.OpenReport "reportname", IIf(MsgBox("Preview report?", vbYesNo) = vbYes, acViewPreview, acViewNormal)

This gives user the option. Can use other criteria if prefer.
 

isladogs

MVP / VIP
Local time
Today, 06:58
Joined
Jan 14, 2017
Messages
18,209
Variation on a theme. I use a checkbox:

Code:
 If Me.ChkPreview = True Then
        DoCmd.OpenReport ReportName, acViewPreview
Else
        DoCmd.OpenReport ReportName, acViewNormal
End If

In your case, set the checkbox default = False so the report normally prints without preview
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:58
Joined
Oct 29, 2018
Messages
21,455
Hi. Lost of options for you. You can also have separate buttons to "print," "preview," "email," or "export to PDF."
 

deletedT

Guest
Local time
Today, 06:58
Joined
Feb 2, 2019
Messages
1,218
I have a Print - view option box in my forms

 

Attachments

  • 2019-04-01_8-39-13.jpg
    2019-04-01_8-39-13.jpg
    5.5 KB · Views: 136

Users who are viewing this thread

Top Bottom