this example shows how to add data to 3 tables at the same time using VBA code.
--------------------------
Dim db As Database
Dim rst1 As Recordset
Dim rst2 As Recordset
Dim rst3 As Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("Table1")
Set rst2 = db.OpenRecordset("Table2")
Set rst3 = db.OpenRecordset("Table3")
rst1.AddNew
rst1!Yourfield = Somedata '<<<<<<< put data into table1
rst1!Yourfield2 = Somedata2
rst1.Update
rst2.AddNew
rst2!Yourfield = Somedata '<<<<<<< put data into table2
rst2!Yourfield2 = Somedata2
rst2.Update
rst3.AddNew
rst3!Yourfield = Somedata '<<<<<<< put data into table3
rst3!Yourfield2 = Somedata2
rst3.Update
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.