Unanswered: Sending report to tray two with vba...kind of working
Basically I have code that runs and update query and prints a report based on that data. Before the code runs a message box pops up asking the user if they really want to run the update. When the report prints it should send to tray two. My code is below and Im getting error "The number you used to refer to the report is invalid". Is my IF statement not right?
Private Sub cmdPrintIRTags_Click()
On Error GoTo Err_cmdPrintIRTags_Click
'Message box confirming update
If MsgBox("Inventory Reduction Update?", vbYesNo, "DSW Inventory Reduction") = vbYes Then
'turn off warnings
'run an update query
'open the report that views the data from the update query
DoCmd.OpenReport "rptInventoryReductionSignsNew", acWindowNormal
If Application.Printer.DeviceName Like "*HP LJ300-400*" Then
'Set the report destination paper bin to Tray 2
'Use number not name, cannot exceed 250
Reports(rptInventoryReductionSignsNew).Printer.PaperBin = 2
DoCmd.Close acReport, rptInventoryReductionSignsNew, acSaveNo
Edit: I found the code to send it to tray two online and used that code altering it to what i'm trying to do.