R
rcook2sc
I am looking for a VBA method of checking with a user if they want to print a
report that contains over a certain number of pages (e.g. 20). The code I
have tried (in most OnPrint events!) is of the form:
If Pages > 20 Then
If MsgBox("The report contains " & Pages & " pages. Do you still
want to print it?", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
'continue to print
Else
'cancel the print, closing the report if necessary
End If
End if
I tried DoCmd.Close acReport, Me.Name but ran into problems. I did read
GTajos post on a similar issue but that code did not work for me. Any help
greatly appreciated.
Thanks
report that contains over a certain number of pages (e.g. 20). The code I
have tried (in most OnPrint events!) is of the form:
If Pages > 20 Then
If MsgBox("The report contains " & Pages & " pages. Do you still
want to print it?", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
'continue to print
Else
'cancel the print, closing the report if necessary
End If
End if
I tried DoCmd.Close acReport, Me.Name but ran into problems. I did read
GTajos post on a similar issue but that code did not work for me. Any help
greatly appreciated.
Thanks