2 Criteria? (1 Viewer)

Mik3

Registered User.
Local time
Today, 21:56
Joined
Jul 10, 2003
Messages
60
I have a text box in a form which shows the quantity of a particular tool a person has from a query.
I am using DLookUp, however I have 2 criteria: person and tool.

First, is it possible to have 2 criteria in a query?
And, is it possible to use DLookUp in the control for this?

Thanks,
Mike
 

dcx693

Registered User.
Local time
Today, 16:56
Joined
Apr 30, 2003
Messages
3,265
I think you're asking if you can use 2 criteria in a Dlookup. If so, yes, you can. Use a criteria string like this as the last parameter of that DLookup:

"[field1]=" & Forms!formname!textfield1 & " And [field2]=" & Forms!formname!textfield2
 

Mik3

Registered User.
Local time
Today, 21:56
Joined
Jul 10, 2003
Messages
60
I tried that but it still didn't work.
In the query criteria I have [Forms]![Tool Returns]![Combo53] in one and [Forms]![Tool Returns]![List18] in the other.
Then I wrote this in the control source of the form:
=DLookUp("Expr1","Balance at Location ","[Location ID]=& [Forms]![Tool Returns]![Combo53] & And [Tool ID]=&[Forms]![Tool Returns]![List18]")
where Expr1 is the balance, combo53 is the location and list18 the tool.
What is wrong with this?
 

Mik3

Registered User.
Local time
Today, 21:56
Joined
Jul 10, 2003
Messages
60
my mistake :)
it worked..many thanks dcx693
 

Users who are viewing this thread

Top Bottom