How to copy data into the second table?

japi_s

New member
Local time
Tomorrow, 00:19
Joined
Feb 14, 2007
Messages
4
Hi Guys,
What i am trying to do is, i have two tables called Table1 and Table2.

I have created a form called Form1.
This Form1 has all the fields from Table1.

What i want to do is, as soon as a user fills in the details in Form1, obviuosly it saves those details in Table1, BUT i want it to save a couple of field values into Table2 as well.

How do i go about doing this??

In Table1 i can access the fields by "Me.[Fieldname]" (from the VB script), but how do i access Table2 OR how do i save data to Table2 from Form1.

Thanks
 
You need to have a relationship from table 1 to table 2. Then build a query based on both tables. Build the form using that query as your source.
After reading your post again... Your first problem is your database is not normalized. If your form has all the fields from table1 is there a reason to copy these field values to table2? Are they the same fields in two tables? If so, change it. You really should not need to go to lengthy code to move information from table to table if your DB is set up correctly in the first place. Once you get it normalized I think you'll find the info flows the way you want it to.
 
Last edited:
two options on this either an append qry (easier option) or .addnew in coding

It does depend upon what you are doing with the data

I have a quote table (insurnace) and a bound(on cover) table
the quote table is pretty much as it is and can be amended to the users delight - then we have a bound table on a button is push it adds a new record tot his table - and this table is locked all my accounts/documentation cover from this table covernotes/invocies, and my quote letters come from the quote table

once bound no changes can be made to the data in this table by users
I have used append and as the info and quite large - was not happy with it - so went down the addnew route

check the samples for more info on .addnew
 

Users who are viewing this thread

Back
Top Bottom