for DLookup, you have to put that as part of a logical test or assign to a variable. So like
IF DLookup(...) = something (or use comparison operations such as >, < and so on).
Or
myVariable = DLookup( ... ) , then do a comparison or logical test against myVariable.
Put another way, this
DLookup("[customerid]", "[Transactions]", "[customerid]= '" & Me![CUSTOMERID] & "'" & " And " & "[mon] = " & Me![mon])
returns something (let's assume it returns "ACME"). Your line now reads as
If ACME Then
which makes no sense, yes?
Last edited by Micron; 04-13-2023 at 01:11 PM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.