I'm trying to make a control on a form dependent on a DSUM value and cannot seem to get the code right for multiple conditions.
If I code this:
=DSum("[grams Active]","Extractions","[Retired] = -1")
It works fine.
If I code this:
=DSum("[grams Active]","Extractions","[Extraction Type] = 'Med (Clean)'")
It also works fine.
But if I try to use both conditions like this:
=DSum("[grams Active]","Extractions","[Extraction Type] = 'THC-Med (Clean)' and [Retired] = -1")
It returns no value.
It doesn't report any kind of problem, the control just goes blank. (There are qualifying records and none that have nulls in the [grams active] field.)
Is there something wrong with this syntax? I can't find any examples on line that have "and"s or "or"s in them.
Thanks.
If I code this:
=DSum("[grams Active]","Extractions","[Retired] = -1")
It works fine.
If I code this:
=DSum("[grams Active]","Extractions","[Extraction Type] = 'Med (Clean)'")
It also works fine.
But if I try to use both conditions like this:
=DSum("[grams Active]","Extractions","[Extraction Type] = 'THC-Med (Clean)' and [Retired] = -1")
It returns no value.
It doesn't report any kind of problem, the control just goes blank. (There are qualifying records and none that have nulls in the [grams active] field.)
Is there something wrong with this syntax? I can't find any examples on line that have "and"s or "or"s in them.
Thanks.