The
RecordsetClone property provides a copy, or a clone, of the underlying recordset of the form. The recordset provided by the
RecordsetClone property is equivalent to opening a recordset on a table or query, and then using the
Clone method to create a copy of that recordset.
Many developers use the
RecordsetClone property to move through or to operate on the records of a form, independent of the form itself. For example, you can use the
RecordsetClone property when you want to use a method, such as the DAO
Find method, that you cannot use with forms.
Microsoft Access 2000 has a new
Recordset property that gives developers access to the actual recordset that a form uses. In earlier versions of Access, the
RecordsetClone property is available, but it only allows access to a copy of the recordset of a form. By using the new
Recordset property, you can use the
Clone method to create a copy of the recordset to emulate the behavior of the
RecordsetClone property.
Steps to Reproduce Behavior
- Follow steps 1 through 3 in the "Resolution" section earlier in this article.
- Set the OnClick property of the command button to the following event procedure:
Private Sub Command1_Click()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.AddNew
rs!CustomerID = "AAAAA"
rs!CompanyName = "AAAAA Company"
rs.Update
End Sub
- Save the form and close it.
- Open the Customers form in Form view.
- Click the command button.
Note that the form incorrectly moves to a new record and displays the values of the newly added record.