[newbie] Problem combine two working Dlookup

Loranga

Registered User.
Local time
Today, 02:09
Joined
Sep 14, 2010
Messages
13
Aloha,

I'm trying to learn Access and struggeling with a simple Dlookup...
My problem at the moment is that I can't make my dlookup work the way I want to.

In this exaple I would like to show the correct price from the table Pricelist based on the input values in the textboxes Company and Resource (or even better make it work with comboboxes instead).
 

Attachments

Last edited:
Aloha,

I'm trying to learn Access and struggeling with a simple Dlookup...
My problem at the moment is that I can't make my dlookup work the way I want to.

In this exaple I would like to show the correct price from the table Pricelist based on the input values in the textboxes Company and Resource (or even better make it work with comboboxes instead).


I have created a new form for you with a combo box and 3 text box, each object has been named

cboCompany
txtOne
txtTwo
txtThree

The combo box is picking up all the columns from your table and when you select it it shows you everything per row.

Behind the combo box in the properties I have used an after update event to populate the text box based on the columns in the combo box.

I think this is what you want.

If I am correct then all you will need to do is change the column widths to 0cm except the second column so it shows the company name.
 

Attachments

Thank you very much Trevor for taking your time and creating this exaple.
I'm aftraid I did a bad job explaining my problem...
If I use your form I would like to write the company name (or even better use a combobox) in the txtOne box and the resource in txtTwo box. Then have some sort of Dlookup that searches the price for that specific combination of company and resource and then display the price in the txtThree box.

EG.
txtOne = ACME and txtTwo = 1281 will show the price 10 in txtThree
txtOne = ACME and txtTwo = 4213 will show the price 200 in txtThree
txtOne = Microsoft and txtTwo = 4213 will show the price 20 in txtThree


Once again thank you very much. (your example helped me understand how to use the after update event among other things)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom