update secondary id based on other table selection?

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Hey

How do i update a field but display values from another?

I have a query based on two tables.
it is used to display data in a listbox.
there is a relationship between these two tables with Primary Key ID connected to secondary key ID in the other table.

I want the user to be able to change the secondary key ID so that the data in table B is connected to another record in Table A.

Hope this makes sense... im barly understanding this myself :D

But i dont want the user to just update from ID 443 to ID 356
i want the user to see another columns data and pick from that... and then the record the user pick loads the new id.

-----

If noone understand so far... ill try again.

Table A = Profile_id, Names
Table B = Log_id, Profile_id (secondary key), dates

I want user to have a list of names (based on table a, column names
I want user to pick a name and the ID number of that name should change in table B in the column profile_id (secondary key).

Can this be done?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
So if the FK in table B doesn't match the PK in table A, then what is the link between the two tables? You would have to build a query that brings in the fields you need, which must include whatever the two common fields are, and show both the PK and FK fields. You could then base an update query off of that query to update the FK to the PK value.
 
Upvote 0

Forum statistics

Threads
1,223,959
Messages
6,175,644
Members
452,663
Latest member
MEMEH

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
Back
Top