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

Show default value in reports when no data

Status
Not open for further replies.

JulieS

MIS
Nov 23, 2000
48
CA
I'm producing a number of reports (all reports are copied and pasted into one report document). Some reports are blank due to the query returning no data. Is there a way of either not having the report appear or showing a value of 0 (without using the NZ function) when this happens?

(I am working in access 97 and have had no luck with the NZ function).

Thanks,
julie

 
From the help:

The NoData event occurs after Microsoft Access formats a report for printing that has no data (the report is bound to an empty recordset
), but before the report is printed. You can use this event to cancel printing of a blank report.

Remarks

To run a macro or event procedure when this event occurs, set the OnNoData property to the name of the macro or to [Event Procedure].
If the report isn't bound to a table or query (by using the report's RecordSource property), the NoData event doesn't occur.
This event occurs after the Format events for the report, but before the first Print event.

This event doesn't occur for subreports. If you want to hide controls on a subreport when the subreport has no data, so that the controls don't print in this case, you can use the HasData property in a macro or event procedure that runs when the Format or Print event occurs.
The NoData event occurs before the first Page event for the report.

Does this help? Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top