A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

can't get rid of a blank report



 
 
Thread Tools Display Modes
  #1  
Old August 5th, 2004, 09:10 PM
external usenet poster
 
Posts: n/a
Default can't get rid of a blank report

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!!!

  #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!!!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scattered Blank Pages in Report I am Jack's Screwy Report Setting Up & Running Reports 4 July 30th, 2004 11:16 PM
Unwanted Blank Lines in Report Christen Setting Up & Running Reports 1 July 8th, 2004 09:54 AM
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM
Every other page in my report prints blank David Setting Up & Running Reports 2 June 1st, 2004 11:46 PM
Help Printing a Report with Blank Fields Jen New Users 6 May 1st, 2004 02:32 PM


All times are GMT +1. The time now is 10:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.