Evaluating a Textbox on a Report

velcrowe

Registered User.
Local time
Yesterday, 21:22
Joined
Apr 26, 2006
Messages
86
I have a textbox field on a report that I need to evaluate. I would like to evaluate the field to show N/A whenever the report is run and the field is null.
I cannot set the default value to N/A because it stores numbers. Is there a way to do this at the time the report is run? I tried this code with a textbox and label but with no success

If IsNull([Time]) Then Me.dtmTimeLabel.Visible = True

Time being the name of the textbox holding the numeric value and TimeLabel being the label I would to show if the textbox field is empty. Thank you:)
 
Make the textbox unbound. Then in the data source of the text box evaluate the field in the underlying query/table. The data source should look like ....

Code:
= IIF(IsNull([FieldToEvaluate]), "N/A", [FieldToEvaluate])

You should have nothing to do with the label of the field at this point since it is just a placeholder to describe the textbox.

-dK
 
I place an unbound textbox on my form and used the code for the control source but now I am getting an error in the new unbound textbox. Is there something else that I am doing wrong?
 
I place an unbound textbox on my form and used the code for the control source but now I am getting an error in the new unbound textbox. Is there something else that I am doing wrong?
What is the error you are getting now?
 

Users who are viewing this thread

Back
Top Bottom