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

Sign In or Register to comment.

Howdy, Stranger!

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