Solved Part Supersession Fields: Limiting Choice to Existing PNs

dev_omi

Member
Local time
Today, 15:44
Joined
Jul 29, 2022
Messages
34
Hi all. In my current project, I have a parts table that, among other things, tracks part supersession/consolidation. Here is a dummy version focusing on these specific fields:

1668716049741.png


I have both "new" and "current" part number fields so that I can keep track of supersession history: "new" is the immediate supersession, but if that new part is itself superseded, "current" captures the most up to date part number.

Obviously I only want users to be able to select part numbers that actually exist, so I want to create a relationship between these two fields and the parts table--the problem, of course, is that these fields are in the same table. Here is what I am doing now:

1668716234072.png


Is this the right way to achieve what I'm after? It looks sloppy (especially in the real database, since I actually have a third part number field in the same table and the table itself is much bigger (i.e., has more fields)).
 
I would think you do not store in a single table and use a child table. Get rid of new and current in your existing table.

TblPreviousPartNumbers
--- PreviousPartNumberID
---PreviousPartNumber
---DateExpired
---PartID_FK
 
Easy enough, thank you! (You deserve co-developer credit on this database for all of the questions you've answered 😆)
 

Users who are viewing this thread

Back
Top Bottom