Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a lookup table where I have defined some products. I have another table that defines orders. This table defines which products is in the order by having a ID that is linked to another table that has a link to the orders table and to the products lookup table.

Lookup products:

ID: 1
PName: Basketball

ID: 2
PName: Football

Orders:

ID: 1
Products: 3

ID: 2
Products: 5

Products:

Products: 3
PID: 1

Products: 5
PID: 1

Products: 5
PID:2

So in the orders table, one can see that Order 1 has ordered a Basketball, while Order 2 has ordered both a Basketball and a Football.

Now, when you place an order in the Place Order-form, I want the user to be able to choose between the available products, and let them pick them from a list of checkboxes. How is this possible? (When the shop manager adds another product, it is automatically added to the list.)

Is this the correct approach to my problem, or is there a better solution to this?

Edit: I found a solution to this. One could use a list you can select the product, and press an arrow button to add it to another list. The same way you choose fields when making a combo box.

share|improve this question

closed as off topic by JNK Jul 6 '12 at 12:53

Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I think this is more like a stackoverflow.com question –  Remou Jul 5 '12 at 13:54
    
@Remou If this isn't about databases, I think I have misunderstood this QA site a little bit. What is it really about, the back-end of the database? Managing everything that isn't at the query level? I'll read through the FAQ again.. –  Friend of Kim Jul 5 '12 at 21:23
    
Hi, this question isn't a good fit for Database Administrators, and would be better suited to Stack Overflow. However, it looks like you have a history of writing bad questions on Stack Overflow, so what you might like to consider is rewriting some of those questions to be a better fit, so that you can continue to ask questions on Stack Overflow. If you need help editing those questions to get better responses, flag one of your own questions and ask for moderator assistance in the open form text box. We prefer to see questions get written that elicit good responses, and edits over new questions. –  jcolebrand Jul 6 '12 at 15:32
add comment

1 Answer

up vote 1 down vote accepted

You have an order/order detail set-up and this means the easiest way is to create an order form with a detail subform. The subform should be based on the table Products illustrated above, with a combo box for PID drawing the row source from Lookup products. The link child and master fields will be Order ID.

You can see something like this illustrated in the Northwind sample file. The sample files should not be followed exactly, they are only illustrations. In particular, the code is inclined to be a little dodgy.

share|improve this answer
    
Thanks for the answer! I didn't find the file you linked to.. Well, I came up with the solution I wrote as an edit. What would be the best solution. I don't know if I understood you correctly. Should the user be able to pick orders from a combo box, and then enter order details. A subform/table should appear at the bottom, so the user can enter products in the new rows. If this is what you meant, I think the solution I wrote about is better, when the job is first done. (It took some time to set up...) –  Friend of Kim Jul 5 '12 at 21:21
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.