None existant control source on a form

goldenvision

Registered User.
Local time
Today, 22:50
Joined
Oct 22, 2003
Messages
49
Is it possible to use the visible function to show or hide a none existant control source on a form?
 
goldenvision said:
the visible function

There is no Visible function in VBA - most controls have a Visible property.

goldenvision said:
Is it possible to use the visible function to show or hide a none existant control source on a form?

How could you show something that doesn't exist?
 
Doh! I meant visible property not function.

I phrased the question wrong. I am trying to hide something if it doesn't exist and show it if it does.
 
I am trying to hide something if it doesn't exist and show it if it does.

How can you hide something that it does not exist ? If something does not exist you can neither hide nor show it.
 
I have a text box bound to a control source that doesn't exist (as yet) which when the form is opened displays #Name. I want to hide all text boxes with #Name in them
 
i cannot understand the idea of binding a text box to something which does not exist yet. However, you may simply go to the properties of your textbox and set the visibility to No from there.

By the way, why don't you simply delete such textboxes and create them when you need them ?
 
I agree that it is a bit unusual.

The form is bound to a crosstab query which will eventually contain 60 fields. It currently contains 10 fields although I already know what the names of the additional 50 fields will be. I have bound the text boxes using these names so that as the crosstab increases it will populate the relevant text box. But if the control source doesn't exist (#Name) then hide the text box
 
You could also just remove their ControlSource and code in in when needed:

i.e.

Code:
Me.MyTextBox1.ControlSource = "MyField1"
Me.MyTextBox2.ControlSource = "MyField2"
Me.MyTextBox3.ControlSource = "MyField3"
Me.MyTextBox4.ControlSource = "MyField4"
 
I did think about doing it this way but I am trying to get away from having to mess around with the guts of the form if I can as this will be rolled out to users
 

Users who are viewing this thread

Back
Top Bottom