ACC2000: Using Code to Dynamically Synchronize Two Forms
This article was previously published under Q210060 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access database (.mdb). SUMMARY
This article shows you how to use Visual Basic for Applications to
synchronize a form to the current record on the subform of another form.
The method described in this article synchronizes the form's bookmark with
the bookmark of the form's recordset after searching the recordset for
the current key value from the other form's subform.
NOTE: This article explains a technique demonstrated in the sample file, FrmSmp00.mdb. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base: 2333245 (http://support.microsoft.com/kb/233324/EN-US/) ACC2000: Microsoft Access Sample Forms Database Available in Download Center
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. MORE INFORMATIONCAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database. NOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected. The following example demonstrates how to synchronize the Products form to the current record in the Product List subform on the Categories form.
REFERENCESFor more information about the SysCmd() function, click Microsoft Access Help on the Help menu, type SysCmdFunction in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For additional information about the BuildCriteria function, please see the following article in the Microsoft Knowledge Base: 197586 (http://support.microsoft.com/kb/197586/EN-US/) BuildCriteria Method Gives Error w/ Certain Expressions
208970 (http://support.microsoft.com/kb/208970/EN-US/) Run-time error '2448' with BuildCriteria Method
| Article Translations
|

Back to the top
