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

Validating data in a text box

Status
Not open for further replies.

pcdaveh

Technical User
Joined
Sep 26, 2000
Messages
213
Location
US
I want to validate the format of an account number in a text box. The number looks like
this 13-2801.0 or ##-####.#

How do I check this in code?
 
Why not use an input mask in your textbox to verify that the user enters what you want? Then you don't have to write a bunch of code to do it...

HTH Joe Miller
joe.miller@flotech.net
 
Check the Input Masks property of your textbox (In your property sheet under the Data tab). Just fill in the property as you have it typed ##-####.# and write an a message your user will see if an incorrect value is typed in the validationRule property.

Hope this Helps,
Rewdee
 
I don't want to use the input mask. It interferes with the data in the table. Later when I'm running some queries I need to strip off the first two digits and the last digit. The input mask interferes with the len function.
 
Interferes? You have an option to store or not store the - and the . What's the problem that you're running into?

Joe Miller
joe.miller@flotech.net
 
Where do you choose to store the format in the table yes or no? - or . I wasn't aware of that.
 
I need it stored in just the same format as above or below here:

13-2801.0 or 32-2895.9 etc. ##-####.#

And thanks!
 
I found it under the wizard.
 
Click in the InputMask field on your control's properties and hit F1. It's all there.

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top