Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining data in tables 2

Status
Not open for further replies.

Jeanie

Technical User
Jun 14, 2000
86
US
I know this is a really basic question - but I can't find the answer.

I have a database with 2 tables. Table A has the following fields: Original ID, Visits, Allowed (primary key is auto number ID). Table B has Original ID, FQVisits, RVisits, FQNet, RNet, Visits, Allowed (primary key is auto number ID). I set the tables up with a join relationship between original ID.

On Table B the Visits and Allowed columns are empty. I want to bring the Visits and Allowed amounts from Table A to Table B, putting them with the correct Original ID. There are more Original ID's in Table A than there are in Table B, however, all Original ID's in Table B are in Table A.

Any help would be appreciated.

Thanks,

Jeanie
 
You can do this using an update query - bring both tables into the query grid and join them on OriginalID then put the Visit field of tableB into the grid and in the update to type [TableA].[Visits] Set the criteria of Visits for table B to Is Null - being as they are joined on ID the update should be for all fields in B that have no data in currently.
Repeat this for Allowed.
 
Sorry about the two posts...not sure how that happened!

When I do this I get a box that pops up that says "enter parameter value TableA.Visits"....I'm not sure what to put here?

Thx,

Jeanie
 
Oops...sorry, I just realized I updated the table yesterday and changed the field name.

That worked great!

Thx!!

Jeanie
 
The layout of the expression must be exactly as your tables, if you have spaces in your names you must put exactly the same in the query.

[Table A].[Visits]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top