Can anyone see something wrong with this code?
I am getting an error @ the Me.RecordsetCol e 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_AfterUpd ate()
With Me.RecordsetClo ne
.FindFirst "[VetSSN] = """ & Me.Combo0 & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End Sub
Private Sub Combo0_NotInLis t(NewData As String, Response As Integer)
Dim strSQL As String
If MsgBox(NewData & " Is not in the list - Add " & NewData, vbQuestion + _
vbYesNo + vbDefaultButton 2, "Not Found") = vbYes Then
Me.Combo0.Undo
strSQL = "INSERT INTO tblVeteran ( VetSSN )SELECT """ & NewData & """ AS Dummy;"
CurrentDb.Execu te strSQL, dbFailOnError
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClo ne
.FindFirst "[VetSSN] = """ & NewData & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.Combo0.Undo
Response = acDataErrContin ue
End If
End Sub
Any ideas??
Thanks
I am getting an error @ the Me.RecordsetCol e 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_AfterUpd ate()
With Me.RecordsetClo ne
.FindFirst "[VetSSN] = """ & Me.Combo0 & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End Sub
Private Sub Combo0_NotInLis t(NewData As String, Response As Integer)
Dim strSQL As String
If MsgBox(NewData & " Is not in the list - Add " & NewData, vbQuestion + _
vbYesNo + vbDefaultButton 2, "Not Found") = vbYes Then
Me.Combo0.Undo
strSQL = "INSERT INTO tblVeteran ( VetSSN )SELECT """ & NewData & """ AS Dummy;"
CurrentDb.Execu te strSQL, dbFailOnError
Response = acDataErrAdded
Me.Requery
With Me.RecordsetClo ne
.FindFirst "[VetSSN] = """ & NewData & """"
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Else
Me.Combo0.Undo
Response = acDataErrContin ue
End If
End Sub
Any ideas??
Thanks
Comment