From: flores on
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


From: Daniel Pineault on
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.



"flores" wrote:

> 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
>
>
 | 
Pages: 1
Prev: Query List
Next: Change Tab Without changing focus