Problem withj compound combo boxes showing values

J

Joshua

Hello,
I have an interesting problm. I want to build a Form
that shows the price details, number of products sold for
each contract ID.Every contract ID has a few products sold
in it.
I created a Form with 2 combo boxes - one for the contract
ID and the other for the Products. Whenever a particular
contract ID is selected, the second combo box displays the
products that belong to the particular contract. Now, I
want to set the Form in such a way that whenever I choose
a contract ID and a product in that contract, the price of
the corresponding product is displayed. Now, instaed what
happens is, when I select the contract ID, the price
details of the 'first' product in the contract is
displayed. WHen I choose a product in the second combo
box, the price details of the product in some other
contract is displayed.

I hope i was clear in explaning my problem. NAy idea how
to rectify this error?!?

Thanks for any help!!

WIth thanks,
Joshua
 
G

Guest

Put a DlookUp statement in the Control Source of your price Details box like
this
=DLookUp("[Price]","TableName","[ID] = " & Combo1.ID & " And [Product] = '"
& Combo2.Product & "'")

The above statement assumes your ID is numeric. If it is text then put
single apostrophe around as for the Product
 

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