Assigning identical data to 2 tables at the same time.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
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.
 
Run an append query as already mentioned.

Taking the values from the Form as parameters for the Query.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top