A hidden label to appear on click of a checkbox

  • Thread starter evilcowstare via AccessMonster.com
  • Start date
E

evilcowstare via AccessMonster.com

Hi I have a check box on my form, which when checked I would like a label or
text box to become visible as like a warning/note that it is checked.
I dont want like a pop up or anything but an actual text that will sit in the
form the same as a label would.
The checkbox is called .. recordlock
Im guessing that I will need something like

IF
Me.checkbox = True
Then
Me.Message.Visable = True

ELSE
Me.checkbox = False
Then
Me.Message.Visable = False

Im guessing this would need to go in the checkbox_on click and the Form_on
current

As you have probably noticed Im guessing at the code but just trying to show
that I am actually trying to work it out myself :blush:)

If anyone can straighten it out id be appreciative !
Thanks
Jay
 
K

kingston via AccessMonster.com

Use the checkbox's AfterUpdate event to change the Visible property of the
text and label controls. Also, unless you mean ElseIf, don't set
checkbox=False and don't use Then. Naturally, you need an End If.
 
G

Guest

I often do something simular to what you are describing when I provide a
checkbox for user to indicate "Active or Inactive".

Two things are required.

In the AfterUpdate event of your form, use code like this:

If me.checkbox = True then
Me.NameOfYourLabel.Caption = "Active"
Else
Me.NameOfYourLabel.Caption = "Inactive"
EndIf

Then in the OnCurrent event of your form place the same code.

Replace the "NameOfYourLabel" with the name of the label you want to change
the caption of.

Change the "Active" or "Inactive" to the text you want to appear.

--
HTH

Mr B
email if needed to:
draccess at askdoctoraccess dot com
 
E

evilcowstare via AccessMonster.com

Sorry so what is that actual code I need to put in?

Thanks
Use the checkbox's AfterUpdate event to change the Visible property of the
text and label controls. Also, unless you mean ElseIf, don't set
checkbox=False and don't use Then. Naturally, you need an End If.
Hi I have a check box on my form, which when checked I would like a label or
text box to become visible as like a warning/note that it is checked.
[quoted text clipped - 22 lines]
Thanks
Jay
 
K

kingston via AccessMonster.com

You pretty much had it correct. Use the checkbox's AfterUpdate event and:

If Me.Checkbox = True Then
Me.ControlNameLabel.Visible = True
Else
Me.ControlNameLabel.Visible = False
End If
Sorry so what is that actual code I need to put in?

Thanks
Use the checkbox's AfterUpdate event to change the Visible property of the
text and label controls. Also, unless you mean ElseIf, don't set
[quoted text clipped - 5 lines]
 
E

evilcowstare via AccessMonster.com

Hi I tried the code but I just kept getting error messages??

Doesnt seem to like it for some reason, kept saying ambiguous name, I checked
and double checked everything even copy and pasted the names from the
original just in case but still says no?

Thanks for trying though, not sure what its problem is


Mr said:
I often do something simular to what you are describing when I provide a
checkbox for user to indicate "Active or Inactive".

Two things are required.

In the AfterUpdate event of your form, use code like this:

If me.checkbox = True then
Me.NameOfYourLabel.Caption = "Active"
Else
Me.NameOfYourLabel.Caption = "Inactive"
EndIf

Then in the OnCurrent event of your form place the same code.

Replace the "NameOfYourLabel" with the name of the label you want to change
the caption of.

Change the "Active" or "Inactive" to the text you want to appear.
Hi I have a check box on my form, which when checked I would like a label or
text box to become visible as like a warning/note that it is checked.
[quoted text clipped - 22 lines]
Thanks
Jay
 
E

evilcowstare via AccessMonster.com

FANTASTIC!
Not only does it work but for once I actually worked out some of the code lol!
!
Thanks very much for your help!
Its really appreciated!
All the best
Jay
You pretty much had it correct. Use the checkbox's AfterUpdate event and:

If Me.Checkbox = True Then
Me.ControlNameLabel.Visible = True
Else
Me.ControlNameLabel.Visible = False
End If
Sorry so what is that actual code I need to put in?
[quoted text clipped - 5 lines]
 
E

evilcowstare via AccessMonster.com

ITS OK someone else has sorted it for me, thanks very much for your efforts
though !
All the best
Jay
Hi I tried the code but I just kept getting error messages??

Doesnt seem to like it for some reason, kept saying ambiguous name, I checked
and double checked everything even copy and pasted the names from the
original just in case but still says no?

Thanks for trying though, not sure what its problem is
I often do something simular to what you are describing when I provide a
checkbox for user to indicate "Active or Inactive".
[quoted text clipped - 21 lines]
 
E

evilcowstare via AccessMonster.com

JUST A NOTE>>>>
In case anyone else needs to know this, the code works fine, just remember to
also put it in the FORM_On Current as well or the code will only work after
the check box has been clicked and the label will be visible on all records.

Then it works fab !

FANTASTIC!
Not only does it work but for once I actually worked out some of the code lol!
!
Thanks very much for your help!
Its really appreciated!
All the best
Jay
You pretty much had it correct. Use the checkbox's AfterUpdate event and:
[quoted text clipped - 9 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top