Hide a label from another form's control (1 Viewer)

Bobp3114

Member
Local time
Tomorrow, 00:57
Joined
Nov 11, 2020
Messages
42
Is it possible to hide a label on one open form by the click event of a control on another open form?
 

Bobp3114

Member
Local time
Tomorrow, 00:57
Joined
Nov 11, 2020
Messages
42
I have this site and have tried everything but no luck! Would a text box be different to label?
 

561414

Active member
Local time
Today, 09:57
Joined
May 28, 2021
Messages
280
Knowing how to reference things will help you achieve this, CJ_London gave you a link and you say you tried everything but didn't mention what you tried. You have not done anything for what we know.

Check the attached database. Hiding controls in forms is easy, you just reference the control and then add .visible = false
There is one problem, though, hiding a control with focus can't be done, so you have to first move the focus to some other control before attempting to hide it.
 

Attachments

  • referencing.accdb
    356 KB · Views: 67

Bobp3114

Member
Local time
Tomorrow, 00:57
Joined
Nov 11, 2020
Messages
42
Knowing how to reference things will help you achieve this, CJ_London gave you a link and you say you tried everything but didn't mention what you tried. You have not done anything for what we know.

Check the attached database. Hiding controls in forms is easy, you just reference the control and then add .visible = false
There is one problem, though, hiding a control with focus can't be done, so you have to first move the focus to some other control before attempting to hide it.
Yahoo! Thanks. i have been trying using that page of options but I guess not the correcy option.
Thanks again
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:57
Joined
Feb 28, 2001
Messages
27,187
Would a text box be different to label?

It is important to know the names for the different types of control because some of them behave alike, but some are totally different. When you learn to manipulate control properties (e.g. the .Visible property that relates to your question), you would find that controls might appear to have variable sets of properties depending on whether they are bound to a field or not. Other controls cannot be bound at all.

Yes, a text box is different from a label. A label can have content in the form of a caption but only VBA programming can change the caption. Whereas a text box can be intimately associated (we say "bound") to a field in a recordset. It can have a .Value that is related to its bound data source (we say .ControlSource). It is radically important for you to learn the various types available to you. Without knowing those types, you will be at a big disadvantage any time you want to do something unusual, like having one control's status affecting another control's appearance.
 

Users who are viewing this thread

Top Bottom