On Mar 19, 2:22 pm, "storrboy" <storr...@sympatico.cawrote:
Quote:
I would recommend printing reports instead. One of the report events
is OnNoData. If the query the report is based on does not contain
records, printing can be canceled. In a button click event use the
OpenReport method of DoCmd to print them you'd include one line for
each report to print...
>
DoCmd.OpenReport "[reportName]", acViewNormal [or acViewPreview],
[Filter], [Where]
>
In the OnNoData event of the report enter Cancel=True.
So I've got a button that does:
DoCmd.OpenReport "Standard", acViewPreview
DoCmd.OpenReport "Rush", acViewPreview
DoCmd.OpenReport "VIP Rush", acViewPreview
Each form has the OnNoData event set to "Cancel = True"
However, the problem here is that if either of the first two reports
are empty, it cancels the operation and I get a 2501 runtime error
that says "The OpenReport action was canceled." Which makes sense,
since the program thinks the whole thing is being cancelled.
How can I get around this? thanks!