Hide / Show Label

  • Thread starter Lirva S via AccessMonster.com
  • Start date
L

Lirva S via AccessMonster.com

I have a label on a form that I would like to hide/show when I click on a
command button. How I would like it to work is when the form first opens the
label is not visible - you have to click on the command button to display the
label and click on it again to hide it.

Can someone tell me how to get this working.

Thank you!
 
T

tina

in the form design view, set the label's Visible property to False.

on the command button's Click event procedure, add code to "toggle" the
label's Visible property, as

Me!LabelName.Visible = Not Me!LabelName.Visible

hth
 
L

Larry Linson

I have a label on a form that I would
like to hide/show when I click on a
command button. How I would like
it to work is when the form first opens
the label is not visible - you have to
click on the command button to display
the label and click on it again to hide it.

In the Click event of the Command Button:

Me!lblYourLabel.Visible = Not Me!lblYourLabel.Visible

will turn it on if if is off, and off if it is on.

Larry Linson
Microsoft Access MVP
 
L

Lirva S via AccessMonster.com

Awesome. Thanks!

Larry said:
I have a label on a form that I would
like to hide/show when I click on a
[quoted text clipped - 3 lines]
click on the command button to display
the label and click on it again to hide it.

In the Click event of the Command Button:

Me!lblYourLabel.Visible = Not Me!lblYourLabel.Visible

will turn it on if if is off, and off if it is on.

Larry Linson
Microsoft Access MVP
 
Top