I have a situation here whereby I need to include 3 tables in a form without having to use subform becuase there are already too many subforms exist.I can't use query as well because the form shall require data entry. Please help me.<br>Thank you in advance.
The only way to do this is have all of the Text boxes on your form "Unbound". Then write VBA code to add the data from each text box to the correct table<br><br>Look in Help for adding records using VBA<br><br>Very basic concept here:<br>---------------------------<br> Dim MyDB As Database, MySet As Recordset<br> Dim MySet2 As Recordset<br> Dim MySet3 As Recordset<br> Set MyDB = CurrentDb<br> <br> Set MySet = MyDB.OpenRecordset("Table1" ' <<<< your 3 tables here<br> Set MySet2 = MyDB.OpenRecordset("Table2" ' <<<< Notice the "2" on Myset<br> Set MySet3 = MyDB.OpenRecordset("Table3" ' <<<< Notice the "3" on Myset<br> <br> ' Add new records to each table<br> MySet.AddNew<br> MySet2.AddNew<br> MySet3.AddNew<br> <br> ' Insert data to fields in each table<br> MySet![Some Field In Table1] = Me![Some Text box on your form]<br> MySet2![Some Field In Table2] = Me![Second Text box on your form]<br> MySet3![Some Field In Table3] = Me![Third Text box on your form]<br> <br> ' Must HAVE to commint the records to save.<br> MySet.Update<br> MySet2.Update<br> MySet3.Update<br>-----------------------<br><br>OK<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.