Hello,
I have a search function which is kicking out an "error 3021, no current record"
This is because no matching records were found. Now it highlights 'rst.MoveLast' in my code, which moves it to the last record but this obviously isn't working.
The rest of my code is as follows:-
Private Sub DESCRIP_AfterUpdate()
Me.Filter = "[IssueDescription] LIKE '*" & Me![DESCRIP] & "*'"
Me.FilterOn = True
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.MoveLast
MsgBox "Found " & rst.RecordCount & " Records"
Set rst = Nothing
End Sub
Is there another function available for me to use or way of trapping this error so that it doesn't crash!
Regards,
Alex Marchant
Systems Development Engineer
I have a search function which is kicking out an "error 3021, no current record"
This is because no matching records were found. Now it highlights 'rst.MoveLast' in my code, which moves it to the last record but this obviously isn't working.
The rest of my code is as follows:-
Private Sub DESCRIP_AfterUpdate()
Me.Filter = "[IssueDescription] LIKE '*" & Me![DESCRIP] & "*'"
Me.FilterOn = True
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.MoveLast
MsgBox "Found " & rst.RecordCount & " Records"
Set rst = Nothing
End Sub
Is there another function available for me to use or way of trapping this error so that it doesn't crash!
Regards,
Alex Marchant
Systems Development Engineer