what if not found when Finding a record

joltremari

Registered User.
Local time
Today, 01:58
Joined
Jun 4, 2001
Messages
24
what if not found when Finding a record [Resolved]

I am using this code to find a record. I type the info into Text54 and press enter and it finds the first record where the field Age matches the info in Text54. I need a way to display a MsgBox when there was no record found. I have tried several things but no luck so far, any help is greatly appreciated.

JO

Code:
Private Sub Text54_AfterUpdate()
Dim rs As Object

     Set rs = Me.Recordset.Clone
    rs.FindFirst "[Age] = " & Me![Text54] & ""
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub
 
Last edited:
Recordsets have a .NoMatch property.


Also,

Dim rs As Object isn't as explicit as you can make the statement.

Dim rs As DAO.Recordset
 
That's great - thanks for the advice - worked great
 

Users who are viewing this thread

Back
Top Bottom