Dlookup using Yes/No field as criteria

FCrocco

New member
Local time
Today, 00:16
Joined
Sep 26, 2023
Messages
6
I'm not being able to find the correct sintax do use Yes/No field as a criteria in my Dlookup function:

AttachPrep = DLookup("[Flux]", "251 Preparation", "[Selected]= Yes")

Many other sintaxes like -1, true, etc...... all return data type mismatch .

Any help? Any clue?
 
What data type is AttachPrep variable? What field type is Flux?

DLookup() returns Null if no match found. All domain aggregate functions will, except DCount().

Why is DLookup needed? What are you trying to accomplish?
 
Last edited:
It's interesting to note that you used square brackets around the field's name but not around the name of the table that has a space in it. I wonder if that could cause problems as well.
 
No, DBguy, I have tested that. Domain aggregate will accept spaces and symbols in table/query name without brackets but not in field name.
 
No, DBguy, I have tested that. Domain aggregate will accept spaces and symbols in table/query name without brackets but not in field name.
That is very interesting. I wonder what "they" were thinking?
 
I'm not being able to find the correct sintax do use Yes/No field as a criteria in my Dlookup function:

AttachPrep = DLookup("[Flux]", "251 Preparation", "[Selected]= Yes")

Many other sintaxes like -1, true, etc...... all return data type mismatch .

Any help? Any clue?
= DLookup("[Flux]", "251 Preparation", "[Selected]= True")
 

Users who are viewing this thread

Back
Top Bottom