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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report required for no data 1

Status
Not open for further replies.

carwil

Technical User
Feb 7, 2006
4
US
An audit requires a report be printed to display a total number of records for a specified time period. If there are no records for the date range I have envoked a message box to display indicating such, BUT they want a report to print that there were 0 records. AUDITORS!!! Currently, I get #Error in the value field of the report. Is there any way around this?

Thank you!
 
It would help to know the control source of the text box on your report that displays #Error. I expect you need to use something like:
=IIf(HasData,Count(*),0)

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]
 
You may need to use IsError and IIF.

Take an unbound field

IIF(IsError([fieldname]),"0",[fieldname])
 
Auditors (or people who fear them) are definitely make-work type people.

I've had to create reports that show no details. Here's my steps to doing it:

1. create a new query using the existing data source of the report. Give it one column - the count of details in the old data source.

2. Copy the details of the existing report to a sub report.

3. Change the record source of the report to the new count query.

4. Show the one column of the query in the report footer. Add the sub report into the details section to show the records (if any).

If needed, change the count to a sum.

HTH
 
dhookom Thank you so much, this worked perfectly! I had an event procedure to flag input personnel that there was no data, and this prevented the count to display on the report. Once I used your statement and removed the event procedure the report ran as expected. You made some auditors very happy. Thank you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top