How do I show Microsoft Access Print Dialog

  • Follow


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


0
Reply Utf 12/5/2009 12:08:01 AM

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
> 
> 
1
Reply Utf 12/5/2009 12:35:01 AM


1 Replies
1407 Views

(page loaded in 0.04 seconds)

Similiar Articles:
















7/18/2012 8:51:40 AM


Reply: