Form with an unkonwn number of entries?

bakkouz

Registered User.
Local time
Today, 18:25
Joined
Jan 16, 2011
Messages
48
OK guys, here is the case:
I want to create a 'Purchase orders' Form. the form would look something like this:

Item number. Item description. Item quantity. other notes.

now, the purchase order could contain multiple entries(Items), but not specific to a certain number. like for example, in a single order you could place one item or two or five or ten. I could create a specific number of text boxes for the user to enter a certain amount of items, like seven or ten but this would be inefficient, non-practical and would clutter the form.

So, what would be the best practice of creating such a form?
 
Typically this would be done with a form/subform, where the form was bound to an orders table that contained the basic order info and the subform was bound to an order details table that contained a record for each item.
 
Pbaldy, I'm not really sure I understand how to create the structure of the form based on what you've described, could be please elaborate?
 
Have you checked out the Northwind sample db that comes with Access? The orders/order details structure I mentioned is common, and represented there.
 
one addition - the subform should be a continous form

start by creating the subform, just as you create any other form, making it continous form. the subform should display the items (make sure to include the OrderID in the items table !!!)
if you open the subform it should show all item in table (rgardless of OrderID)

next create the order form (as single record form) and put all order details on it.
use the SubForm control to add the ItemsSubForm onto the OrdersForm, and link them using the unique OrderID (this will make sure you only see the items that are belong to the specific order)
 
at the base of this is that you need (at least) 3 tables

suppliers

purchase orders

order items


so 1 supplier = many orders

1 order = many order lines


the purchase order is the header record for the order lines- it will contain details like order no, date placed, ordered by etc - thinks that apply overall to the entire order.

don't try and include product information in the purchase order header table.
 

Users who are viewing this thread

Back
Top Bottom