fraser_lindsay
Access wannabe
- Local time
- Today, 17:24
- Joined
- Sep 7, 2005
- Messages
- 218
I am trying to get a text box to be enabled or disabled according to one of five values in a combo box.
Here's my code in the after update event of the combo box:
It works when I load the form and when I change to "N/A" or "N" it disables the text box but when I try and change back to "O", "F" or "C" it remains disabled.
What have I done wrong?
Also does this need to go in the combo box 'After Update' AND the form's On Current event?
Thanks
Here's my code in the after update event of the combo box:
Code:
Private Sub cboJD_lift_freq_AfterUpdate()
If Me.cboJD_lift_freq.Value = "N/A" Or Me.cboJD_lift_freq.Value = "N" Then
Me.txtJD_lift_max.enabled = False
Else: Me.txtJD_lift_max.enabled = True
End If
If Me.cboJD_lift_freq.Value = "O" Or Me.cboJD_lift_freq.Value = "F" Or Me.cboJD_lift_freq.Value = "C" Then
Me.txtJD_lift_max.enabled = True
Else: Me.txtJD_lift_max.enabled = False
End If
End Sub
It works when I load the form and when I change to "N/A" or "N" it disables the text box but when I try and change back to "O", "F" or "C" it remains disabled.
What have I done wrong?
Also does this need to go in the combo box 'After Update' AND the form's On Current event?
Thanks