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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,999
Office Version
  1. 365
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,025
Messages
5,856,890
Members
431,837
Latest member
megantang

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