I'm trying to open a dialog box using VB code and the vbyesnocancel
i want a report to open when the user clicks yes and when they click no i want to go head a print the report they are on.
Private Sub Command30_Click()
MsgBox ("Would You Like To Attach a Material Sheet?"), vbYesNoCancel
If MsgBox = vbYes Then DoCmd.OpenReport ("rptMaterialSheet"), acViewReport, , , acDialog
If MsgBox = vbNo Then DoCmd.PrintOut , , , acHigh
End Sub
But i get the folowing error
Argument Not Optional
Please Help!!
i want a report to open when the user clicks yes and when they click no i want to go head a print the report they are on.
Private Sub Command30_Click()
MsgBox ("Would You Like To Attach a Material Sheet?"), vbYesNoCancel
If MsgBox = vbYes Then DoCmd.OpenReport ("rptMaterialSheet"), acViewReport, , , acDialog
If MsgBox = vbNo Then DoCmd.PrintOut , , , acHigh
End Sub
But i get the folowing error
Argument Not Optional
Please Help!!