pdvsa
asked on
Dlookup
Hello, I am trying to substract 2 separate values in the following but I get a #error. I imagine its a paren but not sure where. thank you in advance.
=DLookUp("Amount_ Aggregate","tblDraws","ID= " & [DrawIDrpmt])-DLookUp("Amo unt","tblD raws_Detai ls1","Draw IDrpmt=" & [ DrawIDrpmt])
=DLookUp("Amount_ Aggregate","tblDraws","ID=
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I imagine its a parenOr missing Operator?
The first argument in DLookup is an expression where vba checks for missing operators.
DLookup ("x + 2", ...: Expression to look for value of field x + 2.
In what Rayan assumed, your code assumes, because of a space in the name, a missing operator between assumed fields: "Amount_" and "Aggregate".
ASKER
That was it. Thank you
first using your first part of function and see what was being returned?
Open in new window
similarly, do the same for the 2nd function:Open in new window
this will give you clue which part is getting an error and let you handle that error more efficiently.