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

Social Security Number

Status
Not open for further replies.

JIL

Programmer
Jan 30, 2005
1
US
Help Please?!

How can I have a Social Security Field which will put it into social security format with dashes and not allow individuals to input it incorrectly?
 
Jil,
Use the functions 'Position' and 'TextToNum' in the Validation for your field.
Use Position to make sure the hyphens are in the correct places. Use TextToNum to ensure the other stuff is numeric.
Very very roughly -
( Position(..first hyphen....) = 3) and (Position (...second hyphen...) = 7) and .......
and ( Len(TextToNum(SocSec) = Len(SocSec) - [number of hyphens])
(I can't be specific because I don't know the format of your Social Security number.)

Have a look at the help on both of these functions; they are a bit too long to repeat here.
Have fun.
Paul Cheers,
Paul J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top