Table storing primary key from another table instead of the Name field

PartsPig

New Member
Joined
Sep 13, 2024
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I have a main parts table that stores all pertinent information for each part. I also have another table that stores the names of the people who may come pick up those parts. I use a form with a drop down list to select who picks up the parts but the main table is storing the primary key for the people who pick up the parts instead of the Name. How do I correct this?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
OK that makes sense and helped me to understand what I should have asked. In one of my user forms I want the name to be displayed instead of the primary key. How is that accomplished?
 
Upvote 0
Be that as it may, it seems to me that your design is wrong, but then I can only go by your post. There probably ought to be one table for parts, one for pickup people and a junction table for parts/pickup people. That is, unless one person can only pick up one part. Then 2 tables should be enough, but the decision then would be whether the person id goes with the part or the other way around. As soon as two or more people can pick up the same part, or one person can pick up more than one part, you have a design problem.

You accomplish what you want by basing the form on a query and not a table. You'd probably link on the two id fields but include the person table field with the names. I'm not trying to be nit-picky, but Access doesn't have "userforms" they are just forms and are a completely different animal.
 
Upvote 0
OK that makes sense and helped me to understand what I should have asked. In one of my user forms I want the name to be displayed instead of the primary key. How is that accomplished?
Depends on what control you are using. if a combo just show the name column, but use the ID column as bound. Probably best to lock/disable that control if you do not want it being amended.
If a textbox, you could use DLookup() or bring it in the form recordsource.
 
Upvote 0

Forum statistics

Threads
1,225,364
Messages
6,184,523
Members
453,238
Latest member
visuvisu

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