Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code to allow user to select a printer when printing a report

Status
Not open for further replies.

Tessadear

Technical User
Mar 7, 2006
26
BB
I need a user to click on a command button and print a report. My code sends the report directly to the default printer without allowing the user to select a printer.
I need the user to get the dialog box which will allow him to select a printer, before printing.

Here is my code
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Dim stDocName As String

stDocName = "Table1"
DoCmd.OpenReport stDocName, acNormal

Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click

End Sub
 
How about:
Using the Print window
thread703-1308507
 
How are ya Tessadear . . .

Have a look here . . . 5th tip down.
Switching Printers from within your MS Access Application

or

"On The Fly Printing" Functions and Classes for Access

or if you still just want the [blue]print dialog:[/blue]
Code:
[blue]   DoCmd.RunCommand acCmdPrint[/blue]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top