Trapping No Data/Using a Text Box to make determinations

  • Thread starter Thread starter dave b via AccessMonster.com
  • Start date Start date
D

dave b via AccessMonster.com

A field in a query determines what boxes and labels show up in my report.
The field is bound to a text box. Everything works fine if there is data.
If there is no data, there is an error "You entered an expression that has no
value".

Obviously, when there is no data, there is no value in the field I'm using to
make a determination; so, how do I handle this error? I will still use the
report with a single line that says there was no data for the report.

I'm opening the report in preview via form, giving the user the option of
just viewing the report on the screen or printing the report.
 
If you have a text box on the report bound to F1, change its Control Source
to:
=IIf([Report].[HasData], [F1], "No data to display")

Make sure this text boxes name is not the same as the field name, e.g. it
cannot be called F1 in the example above.
 
Back
Top