dear friends,
i want to update the table2 field which is same as table 1 field in ms accessdatabase.
when ever i enter data in table1, table2 field which is same as table1 field should updated.table1 and table2 are connected to form1, form2 seperately.
i request any body, please let me know the code to transfer data from table1 to table2 and update table2 simultaneosy.

Recommended Answers

All 4 Replies

Hi,

In "Save" button of First Table, Insert same Data in Second table as well..
Say, if ID is a PK in your first table, and Second table is same structure as first, then after adding(Save) record, you can run an Insert statement like this:

sSQL = "Insert Into Table2 Select * From Table1 Where ID = " & MyID
Conn.Execute sSQL

Same thing you can do when Editted, Delete the Record from table2 and Insert from table1 (Depending on the ID)

REgards
Veena

Veena,

Dont we have trigger concept in Access..???

thank you veena

Hi,

In "Save" button of First Table, Insert same Data in Second table as well..
Say, if ID is a PK in your first table, and Second table is same structure as first, then after adding(Save) record, you can run an Insert statement like this:

sSQL = "Insert Into Table2 Select * From Table1 Where ID = " & MyID
Conn.Execute sSQL

Same thing you can do when Editted, Delete the Record from table2 and Insert from table1 (Depending on the ID)

REgards
Veena

thank you veena for your reply

Hi,

In "Save" button of First Table, Insert same Data in Second table as well..
Say, if ID is a PK in your first table, and Second table is same structure as first, then after adding(Save) record, you can run an Insert statement like this:

sSQL = "Insert Into Table2 Select * From Table1 Where ID = " & MyID
Conn.Execute sSQL

Same thing you can do when Editted, Delete the Record from table2 and Insert from table1 (Depending on the ID)

REgards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.