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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup Multiple Conditions

Status
Not open for further replies.

CaiSupport

Technical User
Nov 1, 2005
18
US
I am looking for a price, but the Price file could match on Item Number and Price Level or on Item Number and Customer Number. I can get each one to work, but I do not know how to combine them.
Works for Price Level Lookup
=DLookUp("[DiscountMarkupPriceRate1]","All Prices Query","[ItemNumber] = """ & [Forms]![Customers for Service]![CustomerService Subform]!Combo30 & """ AND [ItemCustomerPriceLevel] = """ & [Forms]![Customers for Service]![CustomerService Subform]!Combo42 & """")


Works for Customer Number Lookup
=DLookUp("[DiscountMarkupPriceRate1]","All Prices Query","[ItemNumber] = """ & [Forms]![Customers for Service]![CustomerService Subform]![Combo30] & """ AND [IMB_PriceCode]![CustomerNumber] = """ & [Forms]![Customers for Service]![CustomerNumber] & """")

Thank you
 
Something like this ?
Code:
=DLookUp("DiscountMarkupPriceRate1", "[All Prices Query]", "ItemNumber='" & [Forms]![Customers for Service]![CustomerService Subform]!Combo30 & "' AND (ItemCustomerPriceLevel='" & [Forms]![Customers for Service]![CustomerService Subform]!Combo42 & "' Or CustomerNumber='" & [Forms]![Customers for Service]![CustomerNumber] & "')")

You'll grab only the first price if several records meet the OR condition...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top