U - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

U

jcamdenjcamden Posts: 1Member
I am creating a program for my company which uses a program called speedy schedule using VB script. I need to know the correct syntax i would use to allow us to enter the last 4-digits of a person SSN and having that pull up everyone in our system that matches those digits. The syntax we are currently using requires us to put in the whole SSN and it is as follows:

Private Sub txtSSN_LostFocus()
X = Right(txtSSN.Text, 5)
v = Left(X, 1)
If v <> "-" Then
Dim sTemp As String
sTemp = ""
sStrIn = txtSSN.Text
sStrIn = sStrIn & String$(9, "0")

If sStrIn <> String$(9, "0") Then
sStrIn = Left$(sStrIn, 9)
sTemp = Left$(sStrIn, 3) & "-" & Mid$(sStrIn, 4, 2) & "-" & Right$(sStrIn, 4)
End If
txtSSN.Text = sTemp
End If
End Sub

PLEASE HELP
Sign In or Register to comment.