Easy question: Macro to search all the records of a field and copy specific records into a different table

Will S

Board Regular
Joined
Oct 29, 2013
Messages
69
Heya,

I'm afraid I'm mainly an excel person and adjusting to the differences with access and I'm trying to create a new table out of only a select few records based upon a different table.

The Scenario

I have two tables, CB and CB1, CB is the new table that I want to be made of specific records from CB1, So far I have about 950 and records with nothing but a part numbers (Amount of fields and names of fields are the same in both tables) and I need that filled with all of the fields from CB1 that have the same Part Number as those in CB.

My idea

I was wondering if it's possible to get a macro to loop through each record and say:

"If the record in the "Catalog" field of CB1 = any of the Records in Catalog field of CB, copy the entire record over and move on, else just move on and then just loops until it hits the end of the table."

I know this would be possible in excel but I have very little knowledge of the VBA terminology of access, can anyone help me with this as I really would like to avoid doing this by hand.

Best regards,
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
This is where queries do the heavy lifting for you in Access.

Build a query, joining the two tables on the part nr. Set the criteria for the information you want, add the fields you want displayed and run the query.
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,263
Members
448,881
Latest member
Faxgirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top