Combo Boxes and associated fields.

R

Richard Horne

Hi, I have a problem that is causing me to tear my hair out. I am creating an
ordering system for the company I work at, I am trying to repeat a procedure
I have already used successfuly twice within my database but can't for the
life of me remember how I did this.

I am creating a delivery system for which there are two tables, Deliveries
and Delivery_Details, these link to the tables Orders and Order_Details.

I want a combo box which allows you to select the Order_ID - this is fine I
can create the combo box, but then I need the fields from the Orders table
and the Order_Details to be displayed relating to which ever order. I have
forgotten how I go about getting these fields to look up the data based on
the combo box's contents.

I seem to remember something about just simply creating an empty text box
but then somehow making that display the relevant field - but can't remember
how I did this in the past?

Does this make sense and can anyone help?
 
K

Ken Snell [MVP]

Are you displaying those other fields in controls on the same form? Via a
query that returns all the desired fields? are you using subforms to display
those data?

You don't tell us much info, but in general what you do is use a combo box
to choose a value (as you said you've done), and then use the AfterUpdate
event of that combo box to requery the form's recordsource so that the data
are shown based on that combo box -- and of course the query must use the
combo box as the source of the value in a WHERE clause of the query.
 
R

Richard Horne

Hi Ken, I think I need to explain myself clearer.

As described below I have a table structure of Deliveries and
Delivery_Details and Orders and Order_Details

I want to create a form called deliveries which details each delivery and
the Quantities deliverd on that delivery. I want the user to be able to type
in the Order_ID and then various fields from that table will be displayed. So
I need a combo box which will let the user enter the Order_ID, what do I need
to do to bring the order details relating to that order into my delivery
forms?

Is it best to use a sub form as a datasheet, or can i use text fields for
the order and a separate sub form for the order details? I'm not exactly sure
the best of doing this and so would welcome any advice.

Thanks
 
K

Ken Snell [MVP]

Without seeing your tables, I am not clear about how deliveries and orders
are related, if at all. I assume many orders are delivered in one delivery?
Or are many deliveries associated to a single Order?

I need this info to better advise you about what you want to do. Show a few
examples of the data and how you want the data displayed.
--

Ken Snell
<MS ACCESS MVP>
 

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