Assigning identical data to 2 tables at the same time.

G

GWoodhouse

Access Newbie requiring help.

I have a form with 5 character fields
form_datafield 1
form_datafield 2
form_datafield 3
form_datafield 4
form_datafield 5

I have 2 tables (tableA and tableB) both of which contain the fields
datafield 1, datafield 2, datafield 3, datafield 4, datafield 5.

How can I assign the data from the form to both these tables and can this
code be placed under a Save Button that would be placed on the aforementioned
form?

I have sucessfuly managed to save a record for TableA using the default Save
button but I realy want to create a TableB record assign the details in and
save that record in the same block of code.

P.S the above is obviously a simplified example of what I realy want and in
my actual database the fields in tableA and tableB are not named exactly the
same.
 
C

Craig Alexander Morrison

Why? What is the point of duplicate (or derived data)? You could always use
different queries for display or reporting purposes.

You could use an append query, however, before you continue please ask
yourself why on earth you want to do this.
 
G

GWoodhouse

The reason for doing this is simple.
Auditability.

Everytime TableA is changed I need to log what the changes were in TableB.

Hence when a TableA record is created I need a TableB record created aswell
mirroring what is held in TableA.

Now does anyone know what the code is to do this.....

Thanks.
 
C

Craig Alexander Morrison

Run an append query as already mentioned.

Taking the values from the Form as parameters for the Query.
 
G

GWoodhouse

And how does one go about doing that?

I don't know what an Append Query is or how to take the form values as
parameters.
 
Top