PDA

View Full Version : Access 2007 Print to Specific Tray



daniels012
11-25-2013, 08:20 AM
This may be very simple. I just don't know how to do this.
I need code to print a particular report to a specific Tray
I need to print to Tray 3

Here is the code I currently have:



Function PrintRequestReportMacro()
On Error GoTo PrintRequestReportMacro_Err


DoCmd.Echo False, ""
DoCmd.GoToRecord acForm, "FrmRequestForWO", acNext
DoCmd.GoToRecord acForm, "FrmRequestForWO", acPrevious
DoCmd.OpenReport "RequestforWORpt", acViewPreview, "", "[RequestWOQry]![RequestID]=[Forms]![FrmRequestForWO]![RequestID]"
If (Forms!FrmRequestForWO!NoChargeWO = True) Then
Reports!RequestforWORpt!NoChargeWO.Visible = True
End If
If (Forms!FrmRequestForWO!NoChargeWO = True) Then
Reports!RequestforWORpt!RequestNoChargeLabel.Visible = True
End If
If (Forms!FrmRequestForWO!NoChargeWO = False) Then
Beep
MsgBox "Put a green sheetof paper in the printer then hit OK", vbInformation, ""
End If
If (Forms!FrmRequestForWO!NoChargeWO = True) Then
Beep
MsgBox "Put a Purple sheet of paper in the printer then hit OK", vbInformation, ""
End If
DoCmd.PrintOut acPrintAll, 1, 1, acHigh, 1, True
DoCmd.Close acReport, "RequestforWORpt"
DoCmd.GoToRecord acForm, "FrmRequestForWO", acNewRec
Exit Function




PrintRequestReportMacro_Exit:
Exit Function


PrintRequestReportMacro_Err:
MsgBox Error$
Resume PrintRequestReportMacro_Exit


End Function

mrojas
11-28-2013, 01:41 PM
Try this link: http://www.accessforums.net/programming/choose-printer-tray-vba-code-27054.html