Link to home
Start Free TrialLog in
Avatar of dpeel
dpeel

asked on

Social Security numbers in Outlook 98 custom form

I have run into a road block in setting up this field.

What I want is the typical format 000-00-0000 which the form accepts w/no errors. It won't however save the information.

It would be ideal if the slashs stayed in place and after entering 3 digits jump to the area holding the next two digits and jump to the last four.

Another slight annoyance is the date of birth field after being enter as 01/01/2001 it displays as January,01, 2001.

Appreciate any assistance.
Thanks,
David
Avatar of rjcpjc
rjcpjc

1.  A couple of options.  a)Set up three separate fields.  
b)Use the instr and len functions to test the field to make sure that you have three digits then two then four with dashes in between.

2.  You should be able to go into properties of the field and go to Format and change the date field's format to 01/01/2001.  
Avatar of dpeel

ASKER

I'm ok with answer #2.

I need more bonehead type instructions for the first question.
Thanks
Here is some sample code for b:

tmpSSN = Item.UserProperties.Find("ssn").Value
SSNLength = Len(tmpSSN)

If SSNLength <> 11 then
  msgbox "Your SSN does not have enough characters.  Please reenter"
End If

'Test for a dash in the first four characters

tmpSSN1 = Left(tmpSSN,4)
fdp = Instr(tmpSSN1,"-")

If fdp <> 4 then
   msgbox "You must have a dash (-) as the fourth character"
End If

'Takes the next three characters from the string

tmpSSN2 = Mid(tmpSSN,5,3)  

fdp2 = Instr(tmpSSN2,"-")
If fdp2 <> 3 then
  msgbox "You must have a dash as the 7th character"
End If

------

Hope this helps a little.  Get the Visual Basic Help Files from Microsoft's site.  They are very helpful.  





Avatar of dpeel

ASKER

I don't know jack about Visual Basic. Is there an alternative method built into the Outllok 98 program?
ASKER CERTIFIED SOLUTION
Avatar of rjcpjc
rjcpjc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial