How to Use Recordset FindFirst and NoMatch in Access VBA
Question details
The user needs to know the correct way to check if a specific record was found after executing a FindFirst search on an Access form recordset.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Searching for a specific topic using a combo box within a filtered continuous form recordset.
- Observed behavior
- Developers mistakenly check for the EOF (End of File) property, which does not accurately indicate if the FindFirst method successfully found a matching record.
Ensure your Microsoft Access database is open and you have basic familiarity with writing VBA code for form recordsets.
Utilize the NoMatch Property to Verify FindFirst Results
Replace the EOF check with the NoMatch property to accurately determine if the FindFirst method located the desired record, and then synchronize the bookmarks.
When you use the FindFirst method in a Microsoft Access DAO recordset, the system does not use the EOF (End of File) marker to indicate a failed search. Instead, it utilizes the NoMatch property.
Using bookmarks is highly effective in this scenario because it positions the continuous form on a specific record while retaining the visibility of all other records, unlike a hard filter which hides non-matching records.
In your VBA editor, run the FindFirst method on your RecordsetClone object based on the value selected in your combo box.
Instead of checking 'If Not rs.EOF Then', change your code to test 'If Not rs.NoMatch Then'. This accurately verifies if the record was successfully found.
If the NoMatch property returns false (meaning a match was found), set the form's bookmark equal to the recordset's bookmark (e.g., Me.Bookmark = rs.Bookmark) to navigate directly to that record.
If NoMatch evaluates to true, write an 'Else' statement to trigger a message box that notifies the user the selected topic is unavailable in the current filtered recordset.

Looking for a Lightweight Productivity Suite? Try WPS Office
While WPS Office does not include a database management tool like Access, it serves as a powerful, free alternative for all your primary document, spreadsheet, and presentation needs. Experience seamless performance with an intuitive interface.

Frequently Asked Questions
Why shouldn't I use EOF with the FindFirst method?
The FindFirst method in DAO recordsets does not trigger the End of File (EOF) property when a search fails. Instead, it updates the NoMatch property. Checking EOF will lead to inaccurate results and potential VBA runtime errors.
What is the difference between applying a filter and using a bookmark?
Applying a filter restricts the form's recordset to only display records that meet the specified criteria, hiding everything else. Using a bookmark simply navigates the form to a specific record while leaving all other records visible.
What happens to the current record if NoMatch is true?
If NoMatch is true, the FindFirst method did not find a matching record. The current record position in the recordset becomes undefined or remains at its previous state. Always handle this scenario by alerting the user.




