I have the following code in the Keypress event of a textbox.
VB Code:
If Val(txtRooms) = 0 Then MsgBox "Zero is an invalid entry", vbInformation, "Invalid Entry" txtRooms = vbNullString txtRooms.SetFocus Exit Sub Else Call cmdSubmitChange_Click End If
It works but it doesn't reset the value in the textbox. For example, if the user enters "0", it fires the msgbox saying it's an invalid entry, and then it pops the zero into the textbox. How do I tell it NOT to display the value just entered?




Reply With Quote