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!

Characters, how do i limit in my table? 1

Status
Not open for further replies.

VLADY218

Technical User
Feb 7, 2003
133
US
In my table I have a field called Serial Number. How do I limit the users from putting in certain characters like a hyphen. I Just want them to be able to put in any combination of numbers and letters without other characters so there is a standard. In validation rule I can only input strings but not characters. Is this possible and how can i do it. Example: Serial Number 123-456-343 should only be typed as 123456343 and if they try to put a hyphen in it will give them an error

Thank you

 
But the input mask wont work as i want it to. It will just set the pattern but wont lock out the users from inputing characters such as hyphens or comma's.


Thanks
 
An input mask for your Serial-No example could look like this:
000000000;;_
The zero will not allow hyphens or commas, but it will require a nine digit input.
You'll find examples in Help under "InputMask Property Example — Useful Input Masks"

Hope this helps,

TomCologne
 
Yes, thats what i thought would work, but then i could not put in letters. My serial numbers consist of numbers and letters they are computer serial numbers. So i can't get it to give me both and leave out the other characters.
Example SN: 5T90W11

Thanks for your comments. I really would appreciate any other suggestions you might have.
 
The character definitions are listed in Help under "InputMask Property". You may also want to look into "Should I use a data display format or an input mask?".
It all depends on the data you're dealing with. The wider the variety, the wider the definition must be-thus leaving more room for errors, of course.
Here are the definitions, I had Help open , anyway:

0 Digit (0 to 9, entry required, plus [+] and minus [–] signs not allowed).
9 Digit or space (entry not required, plus and minus signs not allowed).
# Digit or space (entry not required; spaces are displayed as blanks while in Edit mode, but blanks are removed when data is saved; plus and minus signs allowed).
L Letter (A to Z, entry required).
? Letter (A to Z, entry optional).
A Letter or digit (entry required).
a Letter or digit (entry optional).
& Any character or a space (entry required).
C Any character or a space (entry optional).
. , : ; - / Decimal placeholder and thousand, date, and time separators. (The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel).
< Causes all characters to be converted to lowercase.
> Causes all characters to be converted to uppercase.
! Causes the input mask to display from right to left, rather than from left to right. Characters typed into the mask always fill it from left to right. You can include the exclamation point anywhere in the input mask.
\ Causes the character that follows to be displayed as the literal character (for example, \A is displayed as just A).
However, this should not keep you from checking out Help.

Maybe this is more help,

TomCologne

 
Great, It works I used the lower case a. It looked like this aaaaaaaaaaaaaaaaaa;; Perfect just what i needed. That was the only thing holding my project back. Im a computer networker not really a software/programmer guru as of yet. Thanks for your help much appreciated. If you need any help on networking let me know.

thanks again
 
Glad I could provide a little help. Thanks for your offer, I would like to take you up on it; most likely sooner than later.

TomCologne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top