Thread
:
Greying out the OK button
View Single Post
#
1
Posted to microsoft.public.excel.programming
Tushar Mehta
external usenet poster
Posts: 1,071
Greying out the OK button
Instead of disabling the OK button until the form is filled in
correctly, use it to validate the contents of the form.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article . com,
says...
I have a form that my users fill out. I want the OK button greyed out
until they fill out the form perfectly. At this point, I have
simplified it down to the following:
Private Sub UserForm_Activate()
btnOK.Enabled = False
End Sub
Private Sub txtEnd_AfterUpdate()
If Not IsNull(txtStart) And Not IsNull(txtEnd) Then
btnOK.Enabled = True
End If
End Sub
The problem is the OK button disables fine, but it never enables. When
I step through the code, it enables. Its like the code doesn't have
enough time to "darken in" the OK button, so it skips it unless the
slow human is doing the processing.
What I am doing wrong?
Reply With Quote
Tushar Mehta
View Public Profile
Find all posts by Tushar Mehta