Disabling text boxes until a combo box selection is made

sstasiak

Registered User.
Local time
Today, 06:42
Joined
Feb 8, 2007
Messages
97
I have a combo box in a form, along with 3 bound text boxes. When the form opens, it opens to a new record so that the form open without any data in the fields.

When it opens, I'd like to disable the 3 text fields until a selection is made in the combo box. I think the code should look something like this, but am not sure how to code the condition of the text box or what action to assign this code to:

Code:
If (combo box selection hasn't been made) Then
   Me.physLNAME.Enabled = False
   Me.physFNAME.Enabled = False
   Me.PhysicianList.Enabled = False
Else
   Me.physLNAME.Enabled = True
   Me.physFNAME.Enabled = True
   Me.PhysicianList.Enabled = True
End If
 
I would set the textboxes to disabled so that they are alway disalbed when the form opens. On the afterupdate event of your combo enable the textboxes.
 

Users who are viewing this thread

Back
Top Bottom