Full Version: Enabling and Disabling a text box
UtterAccess Discussion Forums > And More... > Visual Basic 2003 and Later
op66fantasie
Hi,

I'm a newbie with vba and i'm tyring to accomplish something i believe should be very easy, but for some reason is not working.... I have a form with one combo box 'A' and one text box 'B'. In the 'On Current' event of the form, I'm trying to say that whenever a value is selected in A then text box B gets disabled, whenever A is blank, or Null, then B gets enabled. Heres my code:

----------------------------------------------
Private Sub Form_Current()

If Me.A = Null Then
B.Enabled = True
Else
B.Enabled = False
End If

End Sub
----------------------------------------------

What ends up happening is B stays disabled no matter what change is made. Is it something with the code or the event? Thx.
rbianco
CODE
If IsNull(Me.A) Then


op66fantasie
Thx!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.