Can anyone see something wrong with this code?
I am getting an error @ the Me.RecordsetCole line in the AfterUpdate event.
Run-time error 7951
You entered an expression that has an invalid reference to the RecordsetClone property.
Private Sub Combo0_AfterUpdate()
With Me.RecordsetClone
.FindFirst "[VetSSN] = """ & Me.Combo0 & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End Sub
Private Sub Combo0_NotInList(NewData As String, Response As Integer)
Dim strSQL As String
If MsgBox(NewData & " Is not in the list - Add " & NewData, vbQuestion + _
vbYesNo + vbDefaultButton2, "Not Found") = vbYes Then
Me.Combo0.Undo
strSQL = "INSERT INTO tblVeteran ( VetSSN )SELECT """ & NewData & """ AS Dummy;"
CurrentDb.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClone
.FindFirst "[VetSSN] = """ & NewData & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.Combo0.Undo
Response = acDataErrContinue
End If
End Sub
Any ideas??
Thanks