Forms

A

Airbonzo

I have a form that gives a list of items based on several combo box filters
the user selects. Once this list of items is displayed, I am trying to have a
button that adds it to a certain purchase order, which would be determined by
which record the user had selected on the purchase order form.
Where should I start, what information should I be searching for?
 
K

Ken Sheridan

Normally you would have an OrderDetails table or similar to model the items
per order (see the sample Northwind database for an example of this; sales
orders in that case but the principle is the same). This table references
the keys of the Orders table and a Products table with two foreign key
columns. So to automatically add rows to this table you would need an
'append' query which selects rows from the products table by referencing the
combo boxes on your form as parameters and inserts the OrderID by referencing
the key of the key of the purchase order form's current record as another
parameter.

You may well have most of the query already set up to return the rows in
your form on the basis of the combo box selections, so, if so, it would be a
case of making a copy of the existing query and amending it to create the
append query.

An OrderDetails table would usually have a Quantity field. You would not be
able to insert values into this directly with the append query if you are
simply listing products, so you would need another means of doing this if
necessary. Normally this would be done in a subform of the purchase orders
form, as in the Northwind example.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top