G
Guest
I setup a combo to find records which works well. I then included a filter to
the code and when I select a line in my combo box it displays the record as
filtered but when I select another line it then displays msg:Not
Found:filtered after pressing ok it brings up the record. This then occurs
for every record I find using my combo.
My code is
Private Sub cboMoveTo_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[AKA] = """ & Me.cboMoveTo & """"
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
If Not IsNull(Me.cboMoveTo) Then
Me.FilterOn = True
Me.Filter = "[AKA] = """ & Me.cboMoveTo & """"
Else
Me.FilterOn = False
End If
End Sub
Please advise me of a solution. I think the error is in the code
Many thanks
the code and when I select a line in my combo box it displays the record as
filtered but when I select another line it then displays msg:Not
Found:filtered after pressing ok it brings up the record. This then occurs
for every record I find using my combo.
My code is
Private Sub cboMoveTo_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[AKA] = """ & Me.cboMoveTo & """"
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
If Not IsNull(Me.cboMoveTo) Then
Me.FilterOn = True
Me.Filter = "[AKA] = """ & Me.cboMoveTo & """"
Else
Me.FilterOn = False
End If
End Sub
Please advise me of a solution. I think the error is in the code
Many thanks