Copying cells from one data table and appending them to another using Microsoft Access

  • Thread starter Thread starter kaybroadnax
  • Start date Start date
K

kaybroadnax

Good afternoon. I hope all is well. I have two data tables in
Microsoft Access, Table 1 and Table 2. Both data tables contain about
2.6 million records. However, on Table 1 important information is
missing. The two tables include data concerning mechanical parts,
with both of the tables having corresponding ID#'s that are in
ascending order. I would like to write a macro where the individual
#'s are looked up in Table 2, the completed table, and copied to the
corresponding cells in Table 1. Is this possible? Thank you so very
much for your time. Thank you and take care.
 
Kaybroadnax,

I agree with Karl's advice, that this is not a job for a macro, and an
Update Query is the applicable approach here.

Having said that, I would also say that your very desire to do this
process is possibly flawed. Generally, in a correctly designed
database, you would never have the same information repeated or
duplicated in two tables. So your question to copy data from Table 2 to
Table 1 is very irregular. If you need further advice with this, can
you say a bit more about what you are really trying to achieve here, and
perhaps give some example?
 
Thank you all so very much for your assistance. I will further
expound on the nature of the problem in the post. I just wanted to
thank you both first.
 
I work for a hardware store in Maryland. My supervisors have given me
a copy of the primary database for all of the products that we sell in
our inventory.

In this database are two data tables, Table 1 and Table 2.

In both of these data tables, each product record (numerating
approximately 2.6 million) includes the following fields: Product ID
(which is simply an ID number), Price, and Class (which is a simple N
or G which classifies the product as repairable or non-repairable).

The Product ID's, which is the primary key, in Table 2 are arranged in
ascending order.

Table 2 is actually updated from Table 1. Table 1, therefore, is
missing data.

Table 1 is missing the Class field data for each record.

Tables 1 and 2 share identical ID# data.

What I would like to do is copy the required Class data from the
records in Table 2 and place them the corresponding records in Table
1.

I hope this helps. And once again, thank you all so very much..
 
Kaybroadnax,

Thank you for the further explanation.

However, apart from the details of the fields involved, so much was
clear already from your original post.

The point I was trying to make is that to have the identical information
in two tables makes no sense, and flouts database design principles of
normailisation. If you need the Class or Price data for your data
management purposes, then as long as it is stored "somewhere" in your
database, it can be retrieved as required. That "somewhere" should be
"one place only", and it can in normal circumstances be of no benefit to
have it stored in two places.

So, my question was about why you want to duplicate your data storage.
Sorry, but I don't want to be in the position of advising you *how* to
do something, when *what* you are doing is invalid.
 
Once again thank you both for your assistance. I too question the
relevancy of the task that I was just given. This is simply busy work
given to the new guy. However, after further review of the data and
with your help, I was able to create an update query that has given me
the results I need. But thanx Steve for your input. I thought it was
a little worthless to have two identical records myself. Once again
thanks guys. Take care.
 
Back
Top