Hello All,

I have an "Inputerror" validation for when the user clicks on the "Save or Update" buttons.

This is the code:
vb Code:
  1. Private Function InputError()
  2.  
  3. InputError = True
  4.  
  5.  
  6.    
  7. 'checks to make sure the user inputs only numbers in the zip code
  8. If txtZip.Text <> "" Then
  9.     If Not IsNumeric(txtZip.Text) Then
  10.         Call MsgBox("Zip Code must be numerals only!", vbInformation + vbOKOnly, "Zip Code")
  11.         txtZip.Text = ""
  12.         txtZip.SetFocus
  13.         Exit Function
  14.     End If
  15. End If
  16.  
  17. 'Checks to make sure the user entered a FDID and in the correct format
  18. If txtFDID.Text = "" Or txtFDID.Text <> "" Then
  19.     Dim r As RegExp
  20.     Dim m As String
  21.     Set r = New RegExp
  22.    
  23.    
  24.     r.Pattern = "^[A-Z][0-9][0-9][0-9]$"
  25.     r.IgnoreCase = True
  26.    
  27.     m = r.Test(txtFDID.Text)
  28.    
  29.     If m = False Then
  30.         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" _
  31.         & " three numbers (0-9)!", vbOKOnly, "Note"
  32.         txtFDID.Text = ""
  33.         txtFDID.SetFocus
  34.     End If
  35.     Exit Function
  36. End If
  37.  
  38. InputError = False
  39. End Function

Well the problem is this:

When the user clicks on the Save or Update button and they input the incorrect data, then it goes to the "Inputerror" function.

This works fine, but when I go back and correct the info then click on the Save or Update button - nothing happens!

This is the code for the Save button:

vb Code:
  1. Case "Save"
  2.             If InputError() Then Exit Sub
  3.             With rs
  4.                 If booIsAdding Then .AddNew
  5.                 .Fields("fldFname").Value = txtFname.Text
  6.                 .Fields("fldMI").Value = txtMI.Text
  7.                 .Fields("fldLname").Value = txtLname.Text
  8.                 .Fields("fldFDID").Value = txtFDID.Text
  9.                 .Fields("fldDOB").Value = DTPicker
  10.                 .Fields("fldAddress").Value = txtAddress.Text
  11.                 .Fields("fldCity").Value = txtCity.Text
  12.                 .Fields("fldState").Value = txtState.Text
  13.                 .Fields("fldZip").Value = txtZip.Text
  14.                 .Fields("fldSname").Value = txtSname.Text
  15.                 .Fields("fldChildren1").Value = txtChildren1.Text
  16.                 .Fields("fldDob1").Value = DTPicker1
  17.                 .Fields("fldChild2").Value = txtChild2.Text
  18.                 .Fields("fldDob2").Value = DTPicker2
  19.                 .Fields("fldChild3").Value = txtChild3.Text
  20.                 .Fields("fldDob3").Value = DTPicker3
  21.                 .Fields("fldChild4").Value = txtChild4.Text
  22.                 .Fields("fldDob4").Value = DTPicker4
  23.                 .Fields("fldChild5").Value = txtChild5.Text
  24.                 .Fields("fldDob5").Value = DTPicker5
  25.                 .Fields("fldChild6").Value = txtChild6.Text
  26.                 .Fields("fldDob6").Value = DTPicker6
  27.                 .Fields("fldChild7").Value = txtChild7.Text
  28.                 .Fields("fldDob7").Value = DTPicker7
  29.                 .Fields("fldContact1").Value = txtContact1.Text
  30.                 .Fields("fldRelationship1").Value = txtRelationship1.Text
  31.                 .Fields("fldAddress1").Value = txtAddress1.Text
  32.                 .Fields("fldPhone1").Value = txtPhone1.Text
  33.                 .Fields("fldCell1").Value = txtCell1.Text
  34.                 .Fields("fldOther1").Value = txtOther1.Text
  35.                 .Fields("fldContact2").Value = txtContact2.Text
  36.                 .Fields("fldRelationship2").Value = txtRelationship2.Text
  37.                 .Fields("fldAddress2").Value = txtAddress2.Text
  38.                 .Fields("fldPhone2").Value = txtPhone2.Text
  39.                 .Fields("fldCell2").Value = txtCell2.Text
  40.                 .Fields("fldOther2").Value = txtOther2.Text
  41.                 .Fields("fldContact3").Value = txtContact3.Text
  42.                 .Fields("fldRelationship3").Value = txtRelationship3.Text
  43.                 .Fields("fldAddress3").Value = txtAddress3.Text
  44.                 .Fields("fldPhone3").Value = txtPhone3.Text
  45.                 .Fields("fldCell3").Value = txtCell3.Text
  46.                 .Fields("fldOther3").Value = txtOther3.Text
  47.                 .Fields("fldPrimary").Value = txtPrimary.Text
  48.                 .Fields("fldFdid1").Value = txtFdid1.Text
  49.                 .Fields("fldSecondary").Value = txtSecondary.Text
  50.                 .Fields("fldFdid2").Value = txtFdid2.Text
  51.                 .Fields("fldReligious").Value = txtReligious.Text
  52.                 .Fields("fldSrequest").Value = txtSrequest.Text
  53.                 .Fields("fldComments").Value = txtComments.Text
  54.                 .Update
  55.             End With

What am I doing wrong?