Results 1 to 4 of 4

Thread: [RESOLVED] Error validation issue.

Threaded View

  1. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Re: Error validation issue.

    LOL, I found the mistake!

    I had the "exit function" in the wrong place.

    vb Code:
    1. 'Checks to make sure the user entered a FDID and in the correct format
    2. If txtFDID.Text = "" Or txtFDID.Text <> "" Then
    3.     Dim r As RegExp
    4.     Dim m As String
    5.     Set r = New RegExp
    6.    
    7.    
    8.     r.Pattern = "^[A-Z][0-9][0-9][0-9]$"
    9.     r.IgnoreCase = True
    10.    
    11.     m = r.Test(txtFDID.Text)
    12.    
    13.     If m = False Then
    14.         MsgBox "The information that you have entered for the FDID field is not valid or you forgot to make an entry:" & vbCrLf & "1. The FDID is REQUIRED!" & vbCrLf & "2. The FDID must be in the A123 format!" & vbCrLf & "For example: First entry must be a letter (A-Z) followed by" _
    15.         & " three numbers (0-9)!", vbOKOnly, "Note"
    16.         txtFDID.Text = ""
    17.         txtFDID.SetFocus
    18.         Exit Function <---to here
    19.     End If
    20.     Exit function <--moved this from here
    21. End If

    Thanks anyway!
    Last edited by cfd33; Nov 19th, 2007 at 11:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width