Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent printing empty reports 1

Status
Not open for further replies.

kaatjev

Technical User
Jan 28, 2005
14
0
0
US
Re: thread 816550 (
When looping through the office ID on my tables, it calls up each client. However, when there are no orders from that client, it sends a blank report to the e-mail address.

How do I prevent this from happening?
 
Can't you use DCount() or something in code to determine the number of records that would get returned by your report?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you!
That is exactly what I needed.

I added
Code:
recCount = DCount("[ACCESSION]", "Query1")
   If recCount > 0 Then
      DoCmd.SendObject acSendReport, "CCL", acFormatRTF, rs("E-MAIL ADDRESS"), "", "", "Daily Census Report", "testing daily census", False
   End If

and it no longer sends me a blank report.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top