1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Need Help With VB,

Discussion in 'Visual Basic ( VB )' started by jcamden, May 12, 2009.

  1. jcamden

    jcamden New Member

    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!!!!!!
     
  2. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    :angry:

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

    shabbir Administrator Staff Member

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

    Try to post code which is readable
     
  4. jcamden

    jcamden New Member

    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
     
  5. shabbir

    shabbir Administrator Staff Member

    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.
     

Share This Page