Thanks, Albert...
So your saying base my continous form on a Query based on the main item
and the modifiers?
No, I am saying that you can use a query to pull in description text from
another table. (so, I don't care if you got 2 tables, or 20 tables...I was
JUST giving a good suggestion how to display description text in a column
when you only got the id.
So, in your case:
Continous Form based on [ORDER DETAILS], which has the [Order Number],
[Product ID]. So I should attach the [MODIFIERS] to this as well...
Yes, I would think the above makes sense. Remember, I talked about the issue
of do you allow only ONE modifier for each details, or do you allow "many"?
This is simply a design consideration of yours. If you only are going to
allow ONE modifier, then you get:
Order Number, Product ID, Modifier
In my example, I had:
<no sugar, no cream> the "<>" simply shows this one is selected
in this email!!!
sugar
sugar + cream
So with the above, we simply store the Modifier ID in the Modifier. Of
course, this is not really a relation, but simply a look up value. And,
since we store only the "id" of the modify (along with product id, order
number etc.), then we need a way to display the "description" text from the
modifiers table.
I mentioned, that perhaps a better design would be to allow MORE then one
modifier. This would make the UI for the user simpler, and also make the
system more flexible (however, then to select sugar + cream, it would take
two steps...but likely a better solution (and, you would not have to list
all possible combinations of modifiers for a given detail)). Of course this
better one to many design will takes more work, and more skill on your part.
So, in place of simply storing a simply modiferID, we now are talking about
allow "many" modifiers. So, this would be a one to many relationship. This
would mean we dump the above modiferID, and thus now have to create a
another table. We could call it
"DetailsModiferList"
This table would simply be a "list" of the modifiers the user selected.
Again, we only need to do this if you are going got allow MORE then one
modifier for each details. Thus, our above list now becomes:
sugar
cream
whipping cream
In the above, if we don't select anything, the coffee is black. If you want
sugar, you select sugar. And cream, you select cream. This design would thus
allow MORE then one modifier (and, it is now clear this is what you want)..
<sugar>
<cream>
whipping cream
So, we select the above two modifiers, and when we close the form, we would
NOT stuff the mod id back into the continues form (with order number, and
product id). What we would do is add two records to our table called
OrdersModifedList. (or, we have a design such that you have to add/enter the
modifiers in this pop up continues form. So, really, either you have some
listbox that lets the user select some modifiers, and then write these
modifiers into our OrderModifedList table (by using some code), or have a
form that actually edits the OrdersModifedList table directly (this would
requite less code, as the form would be adding the records..but some code is
going to be needed in either case).
Anyway, my point about using sql to join stuff in was simply to use sql to
display the "text" of the modifier in place of the id. Often, we will and do
use a combo box to do this. However, often we also can use a query to
accomplish this. Much of how this works will be based on how you want the
final UI to work. If the modifier pop up form is a continues form based on a
comb box, then VERY little code would be needed. I would consider building
this form first to get a prototype working. As time progress, I would
probably make this a list box so the user can simply click on each extra
modifier they want (and clicking again on a modifier would un-select it).
Also, there is question of do we use some type of popup form that appears
WHEN you want to change modifiers, or simply a side by side type arrange
(like many of my grid examples have). My bets are a side by side type system
where as you scroll up and down through the details list, on the right side
the "modifies" list shows ..and could be changed at that point (or, you have
to popup a form..and then select the modifiers -- this is extra step but
again, this kind of UI stuff is up to you, and one approach is going to be
preferred over the other depending on how the uses will work with this
stuff).