No DATA

jferna31

Registered User.
Local time
Today, 06:51
Joined
Nov 12, 2003
Messages
15
When a Report has No DATA to display, i don't want receive #Error in a text box. How I can do that?
Please Help me.
 
I think this is what you are asking. The report will have a "No Data" event property. You can attach code to that property so if the query running behind the report does not return any records then you can have a message box come up or something and cancel the running of the report if you want. If you just have missing data in within some fields in your query you need to deal with them in iif statements in the query with an expression like the following:

iif(isnull([yourfieldname],"No Data",[YourFieldName])

Good luck

GumbyD
 
Thank you, I will try it!
 
I tried but I had some problems.
I have this question, In this situation (No Data to retrieve), I want receive a 0 (zero) in a number field instead a "#Error" text, what is the best way to do that?
 
In the "On No Data" event for the report put this code:
Code:
MsgBox "There is no data for this report. Canceling report...", vbInformation
  Cancel = True


EDIT* If you want to have a value returned to a text box on the instance that a report has no data change the above to this:

Code:
MsgBox "There is no data for this report. Canceling report...", vbInformation
  Cancel = True
  forms!yourFormName!YourTextBoxName = "0"


HTH,
Kev
 
Last edited:

Users who are viewing this thread

Back
Top Bottom