How do I load the print dialog box? (Access 2003)

lespritdelescalier

Registered User.
Local time
Today, 05:30
Joined
Mar 16, 2015
Messages
50
Hi everyone,

A bit of background. Users of the db I am working on print using a regular network printer 95% of the time. 5% of the time however, they need to change that printer to another one, or to a PDF printing program. All of the printers they need are installed in their Printers folder.

I can think of two possible courses of action here:

1. load the printer dialog box (preferred)

2. provide them with a custom interface to select a temporary printer

I don't want them to have to load the printers folder and switch the printer temporarily.

If anyone knows how to load the printer dialog, please share! Also, I am open to other courses of action if you have something to suggest.

Thanks!
 
So I kind of figured out a solution to this. I pop the report using the acViewPreview parameter, and then right click on the report header or hit Ctrl-P to print. Does anyone know if I can get a print button to show up at the top of the preview?

I suppose I could code a button into the upper corner of the report, and hide it during the print operation, but I'd rather not if at all possible.

Thanks!
 
All objects have a property whether they are to show during print or not. Check out the property sheet
 
Create a button on your report. Put the following code in the onclick event:
Code:
On Error GoTo ErrHandler

DoCmd.RunCommand acCmdPrint
'DoCmd.Close acReport, Me.Name
Exit Sub

ErrHandler:
    If Err.Number <> 2501 Then MsgBox "Error Number: " & Err.Number & Chr(13) & "Description: " & Err.Description, , "Error"

If you want to hide the button when it prints, there is a property of the button on the Format tab, "Display When". Change this to "Screen Only"

EDIT: This code is from 2007 so I'm not sure if it will work with 2003.
 

Users who are viewing this thread

Back
Top Bottom