PDA

Click to See Complete Forum and Search --> : [RESOLVED] VBA Printing from access


Strider
Apr 26th, 2005, 06:10 AM
im using the following code to print the current record of the form


i was wondering if it is possible to specify in it which printer you would like to print to or display the print dialog even


Private Sub Print_Record_Click()
On Error GoTo Err_Print_Record_Click


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

Exit_Print_Record_Click:
Exit Sub

Err_Print_Record_Click:
MsgBox Err.Description
Resume Exit_Print_Record_Click

End Sub

RobDog888
Apr 26th, 2005, 11:43 AM
Here is how you can set a specific report to use a specific printer.
Dim oReport As Report
DoCmd.OpenReport "Report1", acViewPreview, , , acWindowNormal
Set oReport = Application.Reports("Report1")
Set oReport.Printer = Application.Printers(0) 'Change to printer index you desire.
DoCmd.PrintOut acSelection

Strider
Apr 27th, 2005, 06:08 AM
will that work for printing forms or just access reports

also how is it possible just called the print dialog from the file->print menu