My form has a combo box w/ 6 options, all of which have a corresponding report that needs to be printed. How do I have a specific report print based on the value selected in the combo box?
The combo box values are:
Chair - Standard
Chair - Non Standard
LS/Sofa - Standard
LS - Non Standard
Sofa - Nonstandard
OTHER
My current print command code, which works, but only for one specific report, is below:
Private Sub cmdPrint_Click()
On Error GoTo PrintXCopies_Err
Dim Copies As Integer
txtPrtQtyIDtags.SetFocus
Copies = txtPrtQtyIDtags.Text
DoCmd.OpenReport "rptName", acPreview, "", ""
DoCmd.PrintOut acPrintAll, , , acHigh, Copies, False
DoCmd.Close acReport, "rptName"
PrintXCopies_Exit:
Exit Sub
PrintXCopies_Err:
MsgBox Error$
Resume PrintXCopies_Exit
End Sub
The combo box values are:
Chair - Standard
Chair - Non Standard
LS/Sofa - Standard
LS - Non Standard
Sofa - Nonstandard
OTHER
My current print command code, which works, but only for one specific report, is below:
Private Sub cmdPrint_Click()
On Error GoTo PrintXCopies_Err
Dim Copies As Integer
txtPrtQtyIDtags.SetFocus
Copies = txtPrtQtyIDtags.Text
DoCmd.OpenReport "rptName", acPreview, "", ""
DoCmd.PrintOut acPrintAll, , , acHigh, Copies, False
DoCmd.Close acReport, "rptName"
PrintXCopies_Exit:
Exit Sub
PrintXCopies_Err:
MsgBox Error$
Resume PrintXCopies_Exit
End Sub