Pulling data from one table into another table

alabk

New member
Local time
Today, 12:44
Joined
Dec 11, 2012
Messages
5
Hello All,
I have been having problems merging two sets of data. Although, it is highly possible that I am just over thinking it.
I have received a database with a table (table1) and data already filled in. What I have been asked to do is to upload external data from excel which I have done and named it table2.
Here is the part I have been having trouble with: Table2 only has partial data and table1 has complete data. What I need to do now is update the data in table2 that matches table1. For instance, table2 has field A_Code filled in as U but nothing in any other field, while table1 has A_Code as U, Answer_Code as UB and Answer_Description as description. What I need to do is fill in the data for Answer_Code and Answer_Description into table2, but only when A_Code in table2 matches A_Code in table1. Make sense?
What is the best way to approach this? I’ve been trying to work with an update query and have played around with writing vba code, but can’t seem to get either to work.
I appreciate any help anyone can give.

Thanks!
 
Create two DAO recordsets, move through the first one via loop, use the 'FindFirst' method upon the second and set the field values of the second recordset accordingly if the values of 'A_Code' match.
 
Thank you for the input! I will try it when I have a chance and let you know if I have any questions.
 

Users who are viewing this thread

Back
Top Bottom