How do I show Microsoft Access Print Dialog

F

flores

Using Access 2002

I used the command wizard to create a button on the form to print the form's
currently selected record. The record prints fine, but it does not allow
selecting of a printer. I want to let users select a printer, and then use
the code that the Toolbox Wizard created to print the selected record (code
attached).

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub
 
D

Daniel Pineault

In that case switch your code to

DoCmd.RunCommand acCmdPrint

it will open the print dialog where the user can specify, amongst other
things, the printer to use.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top