I get the error...
the object doesn't contain the automation object 'me'
Dale Fye said:
Try:
with the assumption that [Text21] is the name of a control, not a field, I
would try:
=DSUM("Amount", "Deposits", "[DateDep] = #" & me.text21 & "#")
--
HTH
Dale
email address is invalid
Please reply to newsgroup only.
Gator said:
=DSum("[Amount]","Deposits","[DateDep] =#" & [Text21] & "#")
why am I getting "syntax error in date in query expression"?
thanks
You cannot use the "Me" keyword within the control source of an Access
control or in a query.
"Me" can only be used in VBA.
Your original post states that the DSUM was used in a query (not
directly as the control source of a control).
You do NOT use the = sign in a query expression.
ColumnName

Sum(etc....)
Also, you would need to fully qualify the [Text21] control's address.
ColumnName

Sum("[Amount]","Deposits","[DateDep] = #" &
forms!FormName![Text21] & "#")
So, assuming [DateDep] is a Date Datatype and [Text21] contains a
valid date, the above should work.