R
Robin
Hello,
I'm trying to write a DSum formula with 4 criteria. I've tried several
variations but with no luck. I read Allen Brown's web page on use of quotes
but can't quite apply it. Any help would be appreciatied.
My fifth and latest attempt was (all criteria fields are text):
DSum ("[CSActualHrs]" , "ClientSegment",
" [ClientSegment]![ClientID] = """ & Forms![fmCS]![ClientID] """ AND
[ClientSegment]![EngagementID] = """ & Forms![fmCS]![EngagementID] & """
AND [ClientSegment]![EngagementYr] = """ & Forms![fmCS]![EngagementYr] & """
AND [ClientSegment]![AssignmentID] = """ & Forms![fmCS]![AssignmentID] & """")
I've used the 3-quote and 4-quote combos on some DLookups with fewer
criteria that work.
The error is: "The expression you entered contains invalid syntax" "You
may have entered a comma without a preceding value or identifier"
And I cannot leave the control with the formula still in it.
-The criteria form fields are all bound, text boxes. (No combos or other
types) No criteria fields are null and all are part of the Primary Key for
the Client Segment table.
-The CSActualHrs is a bound numeric field, Single/Fixed 2
Thank you for any help,
Robin
I'm trying to write a DSum formula with 4 criteria. I've tried several
variations but with no luck. I read Allen Brown's web page on use of quotes
but can't quite apply it. Any help would be appreciatied.
My fifth and latest attempt was (all criteria fields are text):
DSum ("[CSActualHrs]" , "ClientSegment",
" [ClientSegment]![ClientID] = """ & Forms![fmCS]![ClientID] """ AND
[ClientSegment]![EngagementID] = """ & Forms![fmCS]![EngagementID] & """
AND [ClientSegment]![EngagementYr] = """ & Forms![fmCS]![EngagementYr] & """
AND [ClientSegment]![AssignmentID] = """ & Forms![fmCS]![AssignmentID] & """")
I've used the 3-quote and 4-quote combos on some DLookups with fewer
criteria that work.
The error is: "The expression you entered contains invalid syntax" "You
may have entered a comma without a preceding value or identifier"
And I cannot leave the control with the formula still in it.
-The criteria form fields are all bound, text boxes. (No combos or other
types) No criteria fields are null and all are part of the Primary Key for
the Client Segment table.
-The CSActualHrs is a bound numeric field, Single/Fixed 2
Thank you for any help,
Robin