Do Not Show Text Box if Empty

depawl

Registered User.
Local time
Today, 12:26
Joined
May 19, 2007
Messages
144
I have a report with a Text Box based on a memo field in a form. Data is not always entered into this field. If data is entered I need it to show on the report. If not data is entered, I would like to have the field not show on the report, including the label. Is there a way to do this?
Thanks,
 
I'm sure you could just do a "If isnull [fieldname].value then [fieldname].visible = false and [labelfieldname].visible = false. Put this under the OnOpen Event of the report.
Or something similar.
 
I'm sure you could just do a "If isnull [fieldname].value then [fieldname].visible = false and [labelfieldname].visible = false. Put this under the OnOpen Event of the report.
Or something similar.

I've been trying to do a similar thing. IsNull only works on numerical values, not text.

Back to my friend, the 'search forums' function...
 
Actually it will work on any Null field, text or numeric, but text fields could contain a zero length string, which will look the same. Try

If Nz(FieldName, "") = "" Then
 
d,

Also, the OnOpen event is probably not the event you want to use.

Use the OnFormat event of your Detail section ... and make sure to
set the CanGrow/Shrink property of the textbox to Yes to prevent
having a potentially large empty space on your report.

Wayne
 
Actually it will work on any Null field, text or numeric, but text fields could contain a zero length string, which will look the same. Try

If Nz(FieldName, "") = "" Then

Sorry to hijack this thread...

I'm getting the above to work SORT OF...

I'm trying to set fields to visible or not depending on whether the text field contains information. I'm using multiple forms. the problem is that ALL of the fields are being set as invisible whether the related text field contains information or not. I'm getting really puzzled and frustrated. I've tried adding and else if statement with no results.

TIA,
Mary
 

Users who are viewing this thread

Back
Top Bottom