View Single Post
  #2  
Old August 6th, 2004, 06:31 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default can't get rid of a blank report

Cancel the NoData event of the report.

That will probably give your macro a different error, saying the OpenReport
was cancelled (error 2501). To avoid that error, you need to use VBA code
instead of a macro, and include error handling that just ignores that error.
One of the most severe limitations of macros is that they contain no error
handling.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
...
I have a macro that opens a report and then I email the
result. If the report is blank I get a type mismatch
error 3 times. I believe the 1st one is when it is
opened and the 2nd when it is printed and the 3rd one
when I try to email the report.

I have to print a report for 50 differnt accounts and my
macro looks like this

open report (with condition acct number = 1000 and date =)
send object
close report

open report (with condition acct number = 1001 and date =)
send object
close report

etc....

If there is no records for a specific account number in
that date range how would I stop the macro from giving me
the type mismatch errors.

Thanks for all of the help!!!