Text Box invisble if contents is null

alxj

Registered User.
Local time
Today, 00:21
Joined
Nov 24, 2000
Messages
36
I have the problem of needing to hide a text box if it contains no value but appear if the control source equation creates a value to put in it. How would i go about doing this.

Thanks

Alex
 
I would put the following type of code into the Form_Current property:

If IsNull(TextBoxThatReceivesValue) Then
Me!TextBoxThatReceivesValue.Visible = False
End If

Hopefully this will work for you
 
SomeGuy has the right idea, but just didn't take it far enough. It should be:

If IsNull(TextBoxThatReceivesValue) Then
Me!TextBoxThatReceivesValue.Visible = False
Else
Me!TextBoxThatReceivesValue.Visible = True
End If

This is needed if you navigate though the records, the txtbox will change in accordance with each record. If you don't include the "Else", the txtbox would become invisible if you incounter a Null, and it would remain that way.

HTH
RDH
 
I am trying to do a similar thing here but I have text boxes on a report that are populated by the reports query. This code does not seem to work. I have tried it on various event procedures but it does not seem to want to work.

I have 5 text boxes that, if the query does not return any results in, these txt boxes are not visible and instead, a message is displayed along the lines of "No items to report this month".

The txt boxes are contained within the detail section of the report, and this is continuous. At present I just get 5 blank text boxes in one row when the query does not return any data.

Can anyone help?

Thanks

(Sorry just realised this is in the forms forum, but it seemed like the most appropriate thread)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom