Updating one table from another table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all..

Ok I have been banging my head for two days trying to do this... There
has to be an easy way of doing this.

I have two tables... exactly the same except for the info contained.
Table A has a bunch of info in it, but some of the stuff needs to be
retrieved from the field IE ImageDate/ImageID/ etc.. So what I want to do is
bring the database from the field and use it to update the database on the
server.

Database A: On main server (with some of the data already entered)
Database B: On laptop that is taken into the field and updates the database
on the laptop

What I want to do is get all the updated field data from database B into
database A.

I want to be able to say: Ok I have some of the data in database A and now
I have updated data in database B...

What Do I need to do in order to get the new info into the old database...

I have ran a query and figured out there are 2314 files that need to be
updated on Database A from Database B.

I have tried numerous update queries and nothing seems to be working.

Each table has 15 fields....... I would like the query to say ok we have
16K entries only 2314 need to be updated, pick those 2314 and update the
necessary fields...

Man this is driving me nuts.....
R~
 
Yes... Since the database are setup the same... I have the autonumber setup
as my primary key as the go between, between both tables within the
database... If this make sense.....

R~
 
If the primary keys identify the same records in each table, you can create
a query with both tables and join them on the PK. Add the fields to the grid
from the table you want to update or search for differences.

Set the criteria under each of the fields to search to
<> [SameFieldFromOtherTable]
make sure you have similar expressions on different rows in the criteria
grid. Confirm that the correct records are selected.

Then change the query to an update query and enter the table and field names
for the updating like:

FieldA
TableToUpdate
TableWithNewValues!FieldA

Run the query.

OH, make sure you only do this after you have backed up and verified the
backup of the MDB.
 
Hello..

Duane Thanks for your help.... One question before I try this:

PK?? What is this....

Thanks again for your help

Rhet



Duane Hookom said:
If the primary keys identify the same records in each table, you can create
a query with both tables and join them on the PK. Add the fields to the grid
from the table you want to update or search for differences.

Set the criteria under each of the fields to search to
<> [SameFieldFromOtherTable]
make sure you have similar expressions on different rows in the criteria
grid. Confirm that the correct records are selected.

Then change the query to an update query and enter the table and field names
for the updating like:

FieldA
TableToUpdate
TableWithNewValues!FieldA

Run the query.

OH, make sure you only do this after you have backed up and verified the
backup of the MDB.

--
Duane Hookom
MS Access MVP


Rhett_Y said:
Yes... Since the database are setup the same... I have the autonumber
setup
as my primary key as the go between, between both tables within the
database... If this make sense.....

R~
 
Sorry, PK is Primary Key. FK is used less often but is the Foreign Key.

--
Duane Hookom
MS Access MVP


Rhett_Y said:
Hello..

Duane Thanks for your help.... One question before I try this:

PK?? What is this....

Thanks again for your help

Rhet



Duane Hookom said:
If the primary keys identify the same records in each table, you can
create
a query with both tables and join them on the PK. Add the fields to the
grid
from the table you want to update or search for differences.

Set the criteria under each of the fields to search to
<> [SameFieldFromOtherTable]
make sure you have similar expressions on different rows in the criteria
grid. Confirm that the correct records are selected.

Then change the query to an update query and enter the table and field
names
for the updating like:

FieldA
TableToUpdate
TableWithNewValues!FieldA

Run the query.

OH, make sure you only do this after you have backed up and verified the
backup of the MDB.

--
Duane Hookom
MS Access MVP


Rhett_Y said:
Yes... Since the database are setup the same... I have the autonumber
setup
as my primary key as the go between, between both tables within the
database... If this make sense.....

R~

:

Do you have a primary key to uniquely identify record matches between
the
tables?

--
Duane Hookom
MS Access MVP
--

Hi all..

Ok I have been banging my head for two days trying to do this...
There
has to be an easy way of doing this.

I have two tables... exactly the same except for the info
contained.
Table A has a bunch of info in it, but some of the stuff needs to be
retrieved from the field IE ImageDate/ImageID/ etc.. So what I want
to
do
is
bring the database from the field and use it to update the database
on
the
server.

Database A: On main server (with some of the data already entered)
Database B: On laptop that is taken into the field and updates the
database
on the laptop

What I want to do is get all the updated field data from database B
into
database A.

I want to be able to say: Ok I have some of the data in database A
and
now
I have updated data in database B...

What Do I need to do in order to get the new info into the old
database...

I have ran a query and figured out there are 2314 files that need to
be
updated on Database A from Database B.

I have tried numerous update queries and nothing seems to be
working.

Each table has 15 fields....... I would like the query to say ok we
have
16K entries only 2314 need to be updated, pick those 2314 and update
the
necessary fields...

Man this is driving me nuts.....
R~
 
Back
Top