Using a RecordsetClone is an easy way to manipulate records on a subform. Often you will use this property to perform an operation, then synchronize the form with the underlying recordset.
For instance:
You may want to create a RecordsetClone to find a record in a subform, and move the form to the record found. In the example below, we are finding the first record with a matching last name, then move to that record if one is found.
Dim strCriteria As String Dim rstEmployees As DAO.Recordset ' Define search criteria strCriteria = "LastName = '" & Me.txtLastName & "'" Set rstEmployees = Me.subFrmEmployees.Form.RecordsetClone ' Find the first occurrence rstEmployees.FindFirst strCriteria If rstEmployees.NoMatch Then MsgBox "No match found" Else ' Move to the record on the subform Me.subFrmEmployees.Form.Bookmark = rstEmployees.Bookmark End If
While there are other ways to perform operations on records in a form or subform, using RecordsetClone is by far the fastest and easiest method.
For more information include a function to call, visit our paper Resyncing a Subform Record in Microsoft Access.
Strategic Overview
Microsoft Access within an Organization's Database Strategy
How many simultaneous Microsoft Access users?
Blaming Microsoft Access instead of the Developer
Microsoft Access Version Feature Differences
Microsoft Access Versions, Service Packs and Updates
Microsoft Office 365 Access Update Version Releases
Top 14 Features Added with MS Access 2007
Taking Over Legacy MS Access Databases
Winner of Every Best Access Add-in Award
Set AutoNumber Starting Number Other than 1
Avoid Unnecessary or Duplicate Indexes
Copy Command Button and Keep Picture
Module VBA to Forms and Controls
Subform Reference to Control Rather than Field
Suppress Page Headers and Footers on the First Page of Your Report
Annual Monthly Crosstab Columns
Add Buttons to the Quick Access Toolbar
Collapse the Office Ribbon for more space
Avoid Exits in the Body of a Procedure
Send Emails with DoCmd.SendObject
Error Handling and Debugging Techniques
Error Number and Description Reference
Remote Desktop Connection Setup
Terminal Services and RemoteApp Deployment
Missing Package & Deployment Wizard
Remove 'Save to SharePoint Site' Prompt from an Access Database
Class Not Registered Run-time Error -2147221164
Microsoft Access to SQL Server Upsizing Center
When and How to Upsize Access to SQL Server
SQL Server Express Versions and Downloads
Deploying MS Access Linked to SQL Azure
SQL Server Azure Usage and DTU Limits