visibility of a label

G

Guest

Hello:
I have a combo box on my form. If the user chose N, then the label next to
it will show up; if Y, then not. When the form is open, the following VB code
works well, but after I save the record, close the form and re-open the form,
it does not work. You will see the label next to the combo box for every
record. Here is the code.

Private Sub TestFORM_AfterUpdate()
If Me.TestFORM = "N" Then
Me.Label100.Visible = True
Else: Me.Label100.Visible = False
End If
End Sub

Any suggestion on it?
Thanks in advance!
 
G

Guest

Try adding the same logic to the On Current event of your form. Leave it in
the After Update event of testFORM as well so when it changes, the label will
respond. Also, just for grins, here is a one liner that doest the same thing.

Me.Label100.Visible = Me.TestFORM = "N" Then
 
G

Guest

Take the then off the end of that. After I clicked post, I saw I had not
finished my copy/paste.
 
G

Guest

It works. Thanks a lot!

Klatuu said:
Try adding the same logic to the On Current event of your form. Leave it in
the After Update event of testFORM as well so when it changes, the label will
respond. Also, just for grins, here is a one liner that doest the same thing.

Me.Label100.Visible = Me.TestFORM = "N" Then
 

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