Need VBA advice with compare 2 record set.

T

TA

Hello all experts,
Can someone give me a basic VBA code to compare data
between 2 table and replace like:
If rs1.clientid=rs2.clientid then
replace rs2.sex with rs1.sex
replace rs2.race with rs1.race
...
endif

Best Regards,
TA
 
A

Allen Browne

Use an Update query.

1. Create a query into the 2 tables, so they are joined on something
appropriate such as ClientID.

2. Change it to an Update query (Update on Query menu).

3. In the new Update row, under the Sex field form Table1, enter:
[Table2].[Sex]

4. Run the query to perform the update.

5. Repeat for the Race field.
 

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

Similar Threads


Top