Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup help

Status
Not open for further replies.
Jan 27, 2004
63
CA
Hi there,

My problem can be very simple for you all. Its with the dlookup function.

Basically I have a Products tables. In that table I have a field called Unit_cost and Product description.

In the form I have the product descriptions in a drop down box. And in the text box I want to display the prices for the products as they are selected in the drop down box.

This is what I have tried so far.

=DLookUp(Product_Prices!Unit_Cost, Product_Prices],Product_Prices!Prod_description=[cbo_desktop])

When I run the form, the text box says "#Name?". What am I doing wrong here?

Any help would be appreciated.
 
I tried that, but still the same problem. This is my revised statement in the control source of the text box

=DLookUp ([Product_Prices!Unit_Cost], [Product_Prices],[Product_Prices!Prod_description]=[cbo_desktop])

 
Try something like this:
Code:
=DLookUp("[Unit_Cost]", "[Product_Prices]","[Prod_description] = ' " & [cbo_desktop] & "'")

Hoc nomen meum verum non est.
 
Looks like ur answer has almost got me there.

But now I am getting a blank and locked text box. Is it because I am displaying the unit price which is in a currency format??
 
I am having a similar problem. I would like to do a Dlookup with 2 sets of critera.

I'd like to find the field SickLate which tells me if a staff member was Sick or Late from the SickLateDataTBL Table . To do this I have to match the SickLateDate with txtSickLateDate and CSRIEXID with txtCSRIEXID, this matchs the date the staff member was sick and the staff member's ID number with data entered into textboxes on the form.

=DLookUp("[SickLate]","[SickLateDataTBL]",[SickLateDate]=[txtSickLateDate] And [CSRIEXID]=[txtCSRIEXID])

Please let me know if you have any sugestions on how I can achieve this.

Thanks
Chris
 
Hi,
Try this without the ' it all depends what type of data.
=DLookUp("[Unit_Cost]", "[Product_Prices]","[Prod_description] = " & [cbo_desktop] & "")

Regards
Duf
 
I forgot to say that the solution worked!!! Thank you all that contributed.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top