Now, I'm assuming that your price is based on the SIZE, but the color doesn't effect the price. So I would have a ProductSizeT table, with records for each Product item:
So you can see now how each Product item has the available sizes listed, with their prices (four for T-shirt, 2 each for Long Sleeve and Jeans, and one for Shorts).
Now you can also have a table for the available colors, but since this doesn't effect the price, it's just something else to select:
ProductColorT ------------- ProductColorID (Autonumber), ProductID (Long), Color (Text) 1, 1, Red 2, 1, Blue 3, 1, Green 4, 2, Red 5, 3, Black etc.
None of this is really new for students who have taken my Access 200-level classes. I cover this kind of stuff in AC201 on.
Now comes the interesting part. You need a way for the user to select an item, then pick the size and color from the available items FOR THAT PRODUCT. This will involve creating combo boxes that have data in them that is refreshed when the product changes.
I would make my standard OrderT order table, like I do in Access 301 (customer data, order date, etc.) and then for the OrderDetailT you're going to need to store all of the above information:
You'll make a series of combo boxes on your OrderDetailF form that will allow you to pick each of the necessary items. You'll pick a product first, and then using the AfterUpdate event for the product, you'll REQUERY the results in the Size and Color combo boxes to show ONLY the results for THAT product that you picked.
I cover something almost exactly like this in Access 313 where we create a Product Category so you can pick a category first and then it will show only the products in that category
Give this a try, follow the example in Access 313 first, and if you still have questions, let me know. This would make a good followup video for a future lesson.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Microsoft Access 301.