Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box for input mask violation

Status
Not open for further replies.

installer69

Programmer
Sep 18, 2004
35
GB
Following on from my previous posts is it possible to get my own text box to pop up for an input mask violation and to get the cursor back at the beginning of the input field after ok is pressed.
 
I haven't read your previous posts, but one way to do this is to use the OnExit event for the text box. In the OnExit event, you would check the format of the data entered. If it is wrong, you would display a message using MsgBox and set the cursor to the beginning of the field using the SelStart Property. Caution: You might consider allowing the user to exit the field if it is blank. Otherwise they will need to enter valid data just to exit the field. You could always disable a button on the form if the user doesn't enter data that is required for the form or record.

dz
dzaccess@yahoo.com
 
If you are using Macros there is always a command to set up error messages.but they vary according to the problem.It could be set up using the command Message box.[Msgbox]where u have the options of setting its as critical or as a normal information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top