How do I stop a character(say a *) and a carriage return(pressing enter) from being entered into a textbox?
Printable View
How do I stop a character(say a *) and a carriage return(pressing enter) from being entered into a textbox?
Trap it in the KeyPress Event, ie.
Code:Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc("*") Or KeyAscii = vbKeyReturn Then KeyAscii = 0
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert