Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Need Help With VB, (http://www.go4expert.com/forums/help-vb-t17491/)

jcamden 13May2009 02:40

Need Help With VB,
I am currently using a program called Speedy Schedule that allows us to book and keep track of patients in the office. Currently, the form requires the patients full SSN, we want it to only require the last 4 digits of the SSN and then be able to provide a list of patients that match those digits when doing a search. I would need to know what the correct syntax for that code might be. Currently our coding 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!!!!!!

SaswatPadhi 13May2009 07:53

Re: Need Help With VB,

Why don't you post your code within a code-block ?

shabbir 13May2009 10:35

Re: Need Help With VB,

Originally Posted by SaswatPadhi (Post 47725)

Why don't you post your code within a code-block ?

Doing so also would not help because they are posted in one line.

Try to post code which is readable

jcamden 15May2009 04:59

Re: Need Help With VB,
Well i tried to do it as readable as possible, but anyway i put it it appears as it is

So is there anyone who would know the correct syntax for the code that would only require the last 4 of the SSN

shabbir 15May2009 09:58

Re: Need Help With VB,
If have the VB editor copy it correctly and post it and try seeing a preview.

If it does not work try pasting it in notepad and then again copy and paste here.

New Line should be preserved no matter what.

Also if the error occurred once it would occur once again no matter how many times you create the thread.

All times are GMT +5.5. The time now is 12:42.