I have been writing a program for a while now, its worked its way up to an inspiring but not really impressive 7 frames.

i have one database showing data from one recordset, and i now want to save from a different one but my code will just not work.
i built it up from examples and help files so i dont have a terrific grasp on the ideas behind.

someone pls tell me what is wrong with this code??
--------------------------------------------
Private Sub cmdSave_Click()
'Check to see if this client already exists in the database
' if so Abort Add
' if not Add this record to database.
With Data4.Recordset
ClientID = FormID(txtFName, txtLName, txtType)
Criterion = "ClientID = " & Chr$(34) & ClientID & Chr$(34)

.FindFirst Criterion
If Not .NoMatch Then
MsgBox "This client is already recorded 10 times within the database" & vbCrLf & _
"You cannot include them again", vbCritical, "ATTEMPT TO REPLICATE RECORD"
Exit Sub
Else
'Add this record to the database
.AddNew
EnterRecordData
.Update
.Requery
End If
End With
End Sub

Function EnterRecordData()
With Data4.Recordset
!First_Name = txtFName
!Last_Name = txtLName
!Department = txtDept
!Address = txtAddress
!Vehicle_Type = txtType
!Cyear = year
!inservicedate = DTDate(0)
!ClientID = ClientID

End With


End Function

Function FormID(FName, LName, Vehicle)
Dim i As Integer
Dim Criterion
While Len(LName) < 4
LName = LName & "_"
Wend
ClientID = Left$(LName, 4) & Left$(FName, 2) & Left$(Vehicle, 2)
For i = 0 To 9
Criterion = "ClientID = " & ClientID & CStr(i)
While Data4.Recordset.NoMatch
Data4.Recordset.FindFirst Criterion
Data4.Recordset.MoveNext
Wend
Next i
ClientID = ClientID & CStr(i - 1)

End Function