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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate user input in combo box 1

Status
Not open for further replies.

jeffmorl

Programmer
Mar 30, 2011
33
US
I must be looking in the wrong places because I haven't been able to find an answer to my question.

I have a user input form that populates an "equipment" table. On this form, I have a combo box bound to a separate table. The user can pick a value from the combo box or enter their own value if it isn't in the list. If they add their own value, it populates this separate table (with a NotInList routine) for future use. If the user enters everything correctly, everything downstream is fine. If not, complications occur.

When and if the user enters a new value, I want to make sure they enter the correct number of characters.

The Input Mask for the combo box is 99\-99999\-99;0; but I'm finding that users have been able to enter values other than what I'm expecting to see, e.g., "-11109-23" or "1-11065-00" or "02-2112-"

Their input must be in the exact format of nn-nnnnn-nn.

How can I make sure that what they enter will be in this exact format with the correct number of numbers?

Thanks in advance.
 
change the 9's to 0. 9's indicate it is optional 0 makes it required

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top