-
1
- #1
jetspin
Programmer
- Mar 5, 2002
- 76
Hi.
I came up with this simple and short solution to
give users the option to either "Print Now", "Preview"
or "Cancel" a report after clicking on a print
button. In this case the button is labled "Print Order"
MsgAnswer = MsgBox("Yes=Print Now. No=Preview. Cancel=Cancel.", vbYesNoCancel, "Print Options")
Select Case MsgAnswer
Case vbYes
DoCmd.OpenReport stDocName, acNormal
GoTo Exit_cmdPrintThisOrder_Click
Case vbNo
DoCmd.OpenReport stDocName, acPreview
GoTo Exit_cmdPrintThisOrder_Click
Case vbCancel
MsgBox "Print Cancelled.", vbOKOnly, "Print Message"
End Select
Exit_cmdPrintThisOrder_Click:
Exit Sub
Err_cmdPrintThisOrder_Click:
MsgBox Err.Description
Resume Exit_cmdPrintThisOrder_Click
I came up with this simple and short solution to
give users the option to either "Print Now", "Preview"
or "Cancel" a report after clicking on a print
button. In this case the button is labled "Print Order"
MsgAnswer = MsgBox("Yes=Print Now. No=Preview. Cancel=Cancel.", vbYesNoCancel, "Print Options")
Select Case MsgAnswer
Case vbYes
DoCmd.OpenReport stDocName, acNormal
GoTo Exit_cmdPrintThisOrder_Click
Case vbNo
DoCmd.OpenReport stDocName, acPreview
GoTo Exit_cmdPrintThisOrder_Click
Case vbCancel
MsgBox "Print Cancelled.", vbOKOnly, "Print Message"
End Select
Exit_cmdPrintThisOrder_Click:
Exit Sub
Err_cmdPrintThisOrder_Click:
MsgBox Err.Description
Resume Exit_cmdPrintThisOrder_Click