Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Kenton, Delaware, USA
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    1. I have a series of reports that I want to automaticly email by either macro or visual basic using a command button.
    2. I have no problem with this if there is data to send with the report("Report1").
    3. I do have a problem with "Report1" when the NoData event value = true.
    4. The NoData event of "Report1" trigers a macro to open a different report ("Report2").
    5. "Report2" is just a template with a statement to the effect that there is no data to report for this time frame.
    6. My problem is, how do I trigger the NoData event to be evaluated before the command decides the name of the report to attach to the email?

    Thanks in advance for your kind consideration on this matter.
    Bill

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Might be worth using something like a DCOUNT function in VBA to check the number of rows returned to the Report 1 query.
    If this is not zero, then you are attaching Report 1 otherwise you can attach Report 2 or better still, just add a bit of extra text to the email body.
    Andrew

  3. #3
    Lounger
    Join Date
    Jun 2010
    Location
    Manchester, NH
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Suggestion...place a label Control (lblFooter) in the Footer on Report1 with the message: "There is no data in this time frame" with it's Visible property set to False. Instead of cancelling the printing of Report1 when there is no data, just set the Visible property of lblFooter = true. (You might also want to set the Visible property of the Details section to False so that you don't see #Error) This way you will have only a single report to maintain and print.

    Bob Oxford
    Bob Oxford
    Software Wizards, Inc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •