visibility of a label

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
Take the then off the end of that. After I clicked post, I saw I had not
finished my copy/paste.
 
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
 
Back
Top