Hi,
I am trying to add an event to a combo box that has two values (yes, no) so that when yes is selected other options appear. I have tested the code in all sorts of different ways but all I could manage was making the other options appear whether I selected yes or no.
Here is my code:
I realise that this probably isnt the most efficient way of writing the code. I need the three labels and textboxes to appear when yes is selected but then disappear again if the user selects no.
Any help would be much appreciated.
I am trying to add an event to a combo box that has two values (yes, no) so that when yes is selected other options appear. I have tested the code in all sorts of different ways but all I could manage was making the other options appear whether I selected yes or no.
Here is my code:
Code:
Private Sub Insurers_Informed_Change(Cancel As Integer)
If Insurers_Informed.AfterUpdate = Yes Then
Me.Label97.Visible = True
Me.txtInsureDate.Visible = True
Me.Label99.Visible = True
Me.txtInsureMethod.Visible = True
Me.Label101.Visible = True
Me.txtInsureWhom.Visible = True
Else
Me.Label97.Visible = False
Me.txtInsureDate.Visible = False
Me.Label99.Visible = False
Me.txtInsureMethod.Visible = False
Me.Label101.Visible = False
Me.txtInsureWhom.Visible = False
End If
End Sub
I realise that this probably isnt the most efficient way of writing the code. I need the three labels and textboxes to appear when yes is selected but then disappear again if the user selects no.
Any help would be much appreciated.