LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Update to Access Multiple tables via VBA



I'm somewhat familiar with updating from Excel to Access via VBA. How
can I update to multiple tables in Access that have a one to many
relationship using VBA. Table are linked via key.

tbl_One is one Many with tbl_Two via Foreign Key
tbl_One is one Many with tbl_Three via Foreign Key


Set db = OpenDatabase("C:\LinkedTest\LinkTestDB.mdb")

' open the database
Set rs = db.OpenRecordset("tbl_One", dbOpenTable)

With rs

..AddNew ' create a new record
' add values to each field in the record
.Fields("TableFieldName2") = Range("A1").Value
.Fields("TableFieldName2") = Range("B1").Value
.Fields("TableFieldName2") = Range("C1").Value

Here I what to updated data to tbl_Two which linked to tbl_One

Here I what to updated data to tbl_Three which linked to tbl_One


.Update ' stores the new record
End With


Thanks


Little Penny






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a Combobox in a Userform access multiple dynamic tables JackyJ Excel Discussion (Misc queries) 0 August 15th 10 01:19 AM
Update multiple pivot tables Svilen Pachedzhiev Excel Programming 4 July 10th 08 01:42 PM
Use Excel to update Access tables vqthomf Excel Programming 1 June 14th 07 06:39 AM
How to update ms access tables directly from ms excel? Nabin New Users to Excel 3 October 11th 06 01:48 PM
How to import multiple sheet of excel into Access database to a diffrent tables?? baka Excel Discussion (Misc queries) 0 July 6th 06 05:48 AM


All times are GMT +1. The time now is 11:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"