ACC2000: Setting Form Recordset Causes Dirty Record to CommitID: Q223224
|
If you have two forms open with the same record source, and you programmatically set the recordset of one form to be equal to the recordset of the second form, any edits you have made thus far on the second form are committed to the data source.
If you have two forms based on the same data source, do not set one form's recordset equal to the other during data entry.
CAUTION: Following the steps in this example will modify the sample
database Northwind.mdb. You may want to back up the Northwind.mdb file
and perform these steps on a copy of the database.
Form: Cat1
------------------------
Caption: Cat1
RecordSource: Categories
Text Box
-------------------------
Name: CategoryID
ControlSource: CategoryID
Text Box
--------------------------
Name: Description
ControlSource: Description
Form: Cat2
-------------------------
Caption: TestForm
RecordSource: Categories
Text Box
-------------------------
Name: CategoryID
ControlSource: CategoryID
Text Box
--------------------------
Name: Description
ControlSource: Description
Beer, ales, teas, coffees, and soft drinks
Set Forms("Cat1").Recordset = Forms("Cat2").Recordset
For more information about the Recordset property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type "recordset property" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Additional query words: pra dirty
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: June 28, 1999