Greying out buttons

junmart

Registered User.
Local time
Today, 22:32
Joined
Sep 14, 2001
Messages
29
i am able to grey out(disable) a command button when textbox1 is empty. but how can i enable the command button once a user enters info in textbox1? this is the code i use:

Private Sub Form_Current()
If IsNull(Me.Text25) Then
Command27.Enabled = False
Else
Command27.Enabled = True
End If
Me.Refresh
End Sub

what else do i need to add? thanks!!
 
Put your code to enable the button into the after update event for textbox1. I don't think that you need to do the me.refresh, but that's a guess.

By the way, let me make a pitch here for renaming your fields and buttons. It's a lot easier to follow code (even your own, a few months later), if you are working with something called txtHomePhone, not Text117, or btnCalcTax, not Command15...
 
thanks a lot! i will follow your advice including naming controls.... thanks again!
 

Users who are viewing this thread

Back
Top Bottom