Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Form, Two Tables, Two Servers 1

Status
Not open for further replies.

sahaitu

Programmer
Jun 8, 2005
29
0
0
US
Greetings:

I have a database with a table stored on the backend and a shared server. These tables are linked to a form.

I would like to have the information inputted into the form placed into tables on the shared server and tables on a more private server.

I guess I forgot to mention, the information I want stored on both tables is the same, it's duplicative.

For instance, I want to store the staff name and ID entered into the form on the table on the shared server as well as a table on the more secure server.

The information has the same PK, though it is to be placed in two separate places.


Is this possible?

Any help is appreciated.

Thanks,
Sahaitu


Thanks
 
You have a few options
one is to open 2 recordsets and append them that way or another is to run an update query
 
Thank you for your reply. Could you please explain a bit more...
 
if you linked the tables already then
recordset using dao
Code:
dim rst1 as recordset,rst2 as recordset
'open both recordsets
set rst1 = currentdb.openrecordset("table1")
set rst2 = currentdb.openrecordset("table2")
rst1.add
rst2.add
rst1.field1 = me.field1 'me being the form
rst2.field1 = me.field1
rst1.field1 = me.field2
rst2.field2 = me.field2
'do for each field on the form
rst1.update
rst2.update
rst1.close
rst2.close
set rst1 = nothing
set rst2 = nothing

or sql and assume form is bound to table1
Code:
INSERT INTO table2
SELECT table1.*
FROM table1
WHERE table1.index= me.index

code is example only you will need to create for your own needs




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top