I have a query that sums a PaymentAmount field (2011 only). This is the query SQL:SELECT Sum(tblPayments.PaymentAmount) AS SumOfPaymentAmount
FROM tblPayments
HAVING (((tblPayments.PaymentDate) Like "*2011"));
I created a form where I want to summarize certain information. I want to include a field called YTDpmts that gives me the result of the above query. I made the control source of the field: =DLookUp("[SumOfPaymentAmount]","zqrySumPmts") and it gives me #Error as the value of the field. I would love to just add the SQL statement above as the control source, but that doesn't work either.
Should I be using DSUM instead? I tried using: =DSum("[PaymentAmount]","tblPayments",Year([PaymentDate])=Year(Now())) but I get #Name?.
Please help.
Thanks in advance.
Al