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

DLookup criteria

Status
Not open for further replies.

mypeljo

Technical User
Apr 16, 2010
12
BG
On my form i want to build a dlookup control looking for the code in the query "QryProductSales" with the crieria called code.I have the control code in the form and i want to look up for the data with the corresponding code in my query.I have built partly the control but i could not define the criteria, they should be as follows : where code in the form is equal to the code in the query. Can you help me ?
My following control has no criteria and cannot work:
="Sales: " & "" & DLookUp("[Bought]";"QryProductSales") where ........?
 
There's no 'where'. Try this
Code:
="Sales: " & "" & Dlookup("[Bought]", "QryProductSales", "[Product] = '" & controlName.Value & "'" )

[green]'or if it's by ProductID or similar situation[/green]

="Sales: " & "" & Dlookup("[Bought]", "QryProductSales", "[ProductID] = " & controlName.Value )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top