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,
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,062
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,437
Messages
5,596,120
Members
414,043
Latest member
thomas Stein

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
Top