Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Access Other topics FAQ

Access Howto:

How do I add data to more than one Table by DougP
Posted: 24 Jun 00

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!Yourfield = Somedata   '<<<<<<< put data into table1
    rst1!Yourfield2 = Somedata2
    rst2!Yourfield = Somedata   '<<<<<<< put data into table2
    rst2!Yourfield2 = Somedata2

    rst3!Yourfield = Somedata   '<<<<<<< put data into table3
    rst3!Yourfield2 = Somedata2

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close