I would greatly appreciate any help I can get with this. I am trying to get a text box to become visible once I make a certain selection in a combo box. I have read several post in reference to this but still cannot get it to work. I am using Access 2010. Please refer to the following information:
Form name: Assign equipment
Combo box name: EquipmentType
Combo box selections: laptop, desktop, Secure Token, Cell phone, Air card
Text Box name: TokenSerialNumber
The visible category under properties for the text box is no.
What I want the form to do is when "Secure token" is selected in the EquipmentType combo box, the TokenSerialNumber text box becomes visible on the form.
Current code:
Private Sub EquipmentType_BeforeUpdate(Cancel As Integer)
If Me.EquipmentType = "Secure Token" Then
Me.[TokenSerialNumber].Visible = True
Else
Me.[TokenSerialNumber].Visible = False
End Sub
The funny thing is when I change the visible property of the text box to yes, the text box displays on the form and when I select Secure Token in the combo box it disappears.
What am I doing wrong?
Form name: Assign equipment
Combo box name: EquipmentType
Combo box selections: laptop, desktop, Secure Token, Cell phone, Air card
Text Box name: TokenSerialNumber
The visible category under properties for the text box is no.
What I want the form to do is when "Secure token" is selected in the EquipmentType combo box, the TokenSerialNumber text box becomes visible on the form.
Current code:
Private Sub EquipmentType_BeforeUpdate(Cancel As Integer)
If Me.EquipmentType = "Secure Token" Then
Me.[TokenSerialNumber].Visible = True
Else
Me.[TokenSerialNumber].Visible = False
End Sub
The funny thing is when I change the visible property of the text box to yes, the text box displays on the form and when I select Secure Token in the combo box it disappears.
What am I doing wrong?