[AccessD] How to access the print dialog box?

Nicholson, Karen cyx5 at cdc.gov
Fri Dec 3 10:08:51 CST 2004


Here is a public function that I use to call:

Public Function PrintOut()
      ' Use the RunCommand method to display the print dialog box.
   On Error GoTo ErrorTrap
   DoCmd.RunCommand acCmdPrint
   Exit Function
ErrorTrap:
   ' Check whether the RunCommand method was canceled.
   ' If RunCommand is canceled, it generates a trappable run-time error
(2501).
   If Err.Number = 2501 Then
     Exit Function
   Else
     MsgBox Err.Number & vbCrLf & Err.Description
   End If
End Function

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Baumann
Sent: Friday, December 03, 2004 10:51 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] How to access the print dialog box?


I am sorry, I should have been more specific...I would like to display
the printer dialog when printing a report from code so that the user
could then select a printer other than the default printer or perhaps
print to a file.

Paul

-----Original Message-----
From: Paul Baumann 
Sent: Friday, December 03, 2004 9:11 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] How to access the print dialog box?

Could someone tell me how to bring up the printer selection dialog box
when printing a report from access?

Thanks in advance.

Paul

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list