hi i need to disable the enter button if there is no characters typed on the text box and when they type then the enter button becomes enabled. i need to use the change event can someone help me out?
Printable View
hi i need to disable the enter button if there is no characters typed on the text box and when they type then the enter button becomes enabled. i need to use the change event can someone help me out?
Would this work for you?
Code:'to ignore spaces use this
Private Sub Text1_Change()
Command1.Enabled = CBool(Len(Trim(Text1.Text)))
End Sub
'or if space is a valid character for you then use this
Private Sub Text1_Change()
Command1.Enabled = CBool(Len(Text1.Text))
End Sub
If the above code doesn't work for you, set the button's Enabled value to False and copy and paste the following code into the Code window:
[VBCODE]
Private Sub txtYourTextBox_Change()
'enable the Enter button
Enter.Enabled = True
End Sub
[/VBCODE]
Happy to help you!
that probably would not work.
thx guys it worked.!!!