cooper collier 4/4/2023 6:38:01 AM The other solution is to use a selection table. There is a variety of ways to do this, without knowing your exact purpose....
Essentially; you have another table with your choices. Sometimes two tables. Table is Pizza toppings... and has a column for Type, and Name and price. Then you make relations one for each choice. If its a meat choice, you can limit the picker to only meat items from the Pizza toppings Table.
You do need to watch out for things when doing this. If you direct link to your selection table, you have to remember that if you ever change anyting in the selection table it will change everything already in the database.
Sometimes you want this, other times you do not.
Example: We recently are creating a way to make invoices. We have a table of FEES, Then Invoice and invoice Item. Fees have items like... paperstacking - $50 ; laundry - $100.
We make an Invoice and then add Invoice Items to it.
INVoice # 1111
Item 1 Paperstacking - $50 Item 2 laundry...
But now we can never ever change those items in the FEES table! If we did, then past invoices change, that would be bad. So, what we do is in the Invoice Item table, we make new columns... I like to use ATO (at time of order) thus, [ATO Item Name] and [ATO Price] Then I set the default value for those columns to the values from the picked FEEs Table.
If I made this as clear as the Mississippi river, I think I explain it better in the videos about relations. Or you can email me directly with your use case and I can give you a better possible solution.
|