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!

Another Social Security # Problem

Status
Not open for further replies.

tdejournett

IS-IT--Management
Jul 4, 2002
6
US
I now need to take the field in my database that has employees social security numbers and remove the dashes between the numbers. They are currently in the form of 111-22-3333 and I want them to be in the form of 111223333.

Can this be done?
 
TDEJ,
For ease of use, leave the standard form of the ss# and on the form create a text box and put
=Mid$([ss#],1,3) & Mid$([ss#],5,2) & Mid$([ss#],8,4)
in the control source.
If in a query, in a blank entry place
Mid$([ss#],1,3) & Mid$([ss#],5,2) & Mid$([ss#],8,4)
in the field of the grid.
the [ss#] refers to whatever the name of your ssnum field is.

jim

 
? basNoDash("111-22-3333")
111223333



Code:
Public Function basNoDash(strIn As String) As String

    'Michael Red 1/2/2003

    Dim MyStr As Variant
    Dim Idx As Integer

    MyStr = Split(strIn, "-")
    ReDim Preserve MyStr(UBound(MyStr) + 1)

    Idx = 0
    While Idx < UBound(MyStr)
        MyStr(UBound(MyStr)) = MyStr(UBound(MyStr)) & MyStr(Idx)
        Idx = Idx + 1
    Wend

    basNoDash = MyStr(UBound(MyStr))

End Function

Your choice, but them data entry folks aren't all that spiffy, at least in my shop. MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
[tt]
Hi, tde:

Y'know...you've got another thread you've made no reply to:

thread702-444334 [glasses][tt] Gus Brunston - Access2000(DAO)[/tt] Intermediate skills.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top