Query Criteria with Dlookup with two conditions

Snowflake68

Registered User.
Local time
Today, 22:05
Joined
May 28, 2014
Messages
464
I am trying to get the correct syntax for the below code.

Code:
DLookUp([CatCode],"LookupCategoryFormat","[LockNetPrice%Disc]= '" & True & "' AND [CatCode]= " & [Category Number] & "")

Category Number and CatCode are both Numeric fields and LockNetPrice%Disc is a Yes/No field.

I need it to return the catcode value where the [CatCode] = [Category Number] AND where the [LockNetPrice%Disc] field = True

But when I run the query using the above line as the criteria in the Category Number field on the query it just throws up a parameter for CatCode.

Can someone help please?
Thanks
 
Just had another thread that did that.
Is it actually called CatCode ? as you get the parameter dialogue when Access cannot identify the field.

However if you are testing for True why not just use

Code:
DLookUp([CatCode],"LookupCategoryFormat","[LockNetPrice%Disc]= True  AND [CatCode]= " & [Category Number] )

Might even be able to get away with not using '= True' as well.? Try it/
 
Last edited:
Dlookup("cATCODE","LookupCategoryFormat","[LockNetPrice%Disc]=True And [CATCODE]=[CATEGORY NUMBER]")
 
I did get the Dlookup working but I actually found another way as it wasn't the solution i needed in the end but thanks for helping out.
 

Users who are viewing this thread

Back
Top Bottom