Access- 2k - How to add data from another table?

G

Geoff Cox

Hello

How do I add data from fields in one table to fields in another table?
Add Query is not the correct approach as I wish to fill empty fields
in the second table, not add the data as new records ...

Ideas please?!

Cheers

Geoff
 
J

John Vinson

Hello

How do I add data from fields in one table to fields in another table?
Add Query is not the correct approach as I wish to fill empty fields
in the second table, not add the data as new records ...

An Update query is the ticket here.

You must have some unique field in the table you want to update, to
join the two tables. Create a Query joining the two tables on this
field; change it to an Update query; and on the UpdateTo line under
the field that you want updated put

=[OtherTable].[Fieldname]

The brackets are essential (if you leave them out it will update a
text field to the string "OtherTable.FieldName" which is not too
helpful!)
 
D

Duane Hookom

You can use an Update query which would join the two tables on unique field
values and the value from one table could update a field in the other table.
 
G

Geoff Cox

Hello

How do I add data from fields in one table to fields in another table?
Add Query is not the correct approach as I wish to fill empty fields
in the second table, not add the data as new records ...

An Update query is the ticket here.

You must have some unique field in the table you want to update, to
join the two tables. Create a Query joining the two tables on this
field; change it to an Update query; and on the UpdateTo line under
the field that you want updated put

=[OtherTable].[Fieldname]

The brackets are essential (if you leave them out it will update a
text field to the string "OtherTable.FieldName" which is not too
helpful!)

John

Got it ! Thanks for your help.

Cheers

Geoff
 
G

Geoff Cox

You can use an Update query which would join the two tables on unique field
values and the value from one table could update a field in the other table.

Thanks Duane - all is well noew!

Cheers

Geoff
 
G

Geoff Cox

On Tue, 20 Jul 2004 19:04:01 -0600, John Vinson

John

I was been too optimistic!

I am attempting to update 5 fields so I add the update boxes and add
for example =[question1].[table2] etc and then run the update query. I
then get an "enter parameter value" request .... what does this mean?

Could it be because I added an autonumber primary key to one of the
tables? I had previously deleted this primary key and I am guessing
that the 2 tables both require a primary key for update query to work?

Geoff
 
G

Geoff Cox

I am attempting to update 5 fields so I add the update boxes and add
for example =[question1].[table2] etc and then run the update query. I
then get an "enter parameter value" request .... what does this mean?

Could it be because I added an autonumber primary key to one of the
tables? I had previously deleted this primary key and I am guessing
that the 2 tables both require a primary key for update query to work?

I may have answered my own question - the update query seems to work
now that I have changed to

=[tablename].[fieldname]

rather than the reverse order which is what I was using bwefore...

Cheers

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top