Hi,
To acomplish what you need intead of
Try
Private Sub txtFee_AfterUpdate()
'grays out the fee box if txtState = FL
If txtState = "FL" Then
txtFee.Enabled = False
Else: txtFee.Enabled = True
End If
End Sub
In design mode double click the txtFee Text Box and insert the modified code.
If it works invite us to Florida
Success
Jose Luis

Originally Posted by
Lost!
Hi all,
I have a userform with some text boxes, and I want one of them to be grayed out depending on the entry in the one before it. If the user types "FL" in the first box, I want the second to be disabled. The trouble is that I want it to check this after the entry in the first box is made and while the userform is still up.
How do I make it happen after the entry is made? It would also work if I could make it happen upon tabbing out of the box or into another. Here's the code I'm trying:
Private Sub txtFee_Change()
'grays out the fee box if txtState = FL
If txtState = "FL" Then
txtFee.Enabled = False
Else: txtFee.Enabled = True
End If
End Sub
This code is fine and works for graying out, but only if the txtState = "FL" at initialization. I want it to work right when FL is entered.
Thanks for your help!
Bookmarks