> Your Where condition is incorrect.
>
> From the fact that you've got the equal sign there, I'm assuming that you're
> trying to set the ControlSource for a text box. When doing that, you must
> leave out the "Me" keyword. As well, the values need to be put outside of
> the quotes.
>
> Assuming AccountColumn is a numeric field, try:
>
> =DSum("Amount", "Deposits", "[AccountColumn] = " & txtAccount & " AND
> DateColumn = " & Year(txtDate))
>
> If AccountColumn is a text field, try:
>
> =DSum("Amount", "Deposits", "[AccountColumn] = '" & txtAccount & "' AND
> DateColumn = " & Year(txtDate))
>
> In case it's not apparent, the difference between the two is that the second
> includes single quotes as well. Exagerated for clarity, it's
>
> =DSum("Amount", "Deposits", "[AccountColumn] = ' " & txtAccount & " ' AND
> DateColumn = " & Year(txtDate))
>
> --
> Doug Steele, Microsoft Access MVP
>
http://I.Am/DougSteele> (no e-mails, please!)
>
>
> "Gator" <Gator[ at ]discussions.microsoft.com> wrote in message
> news:4E18E333-EE7E-4AAE-BB1C-0F90B40130B4[ at ]microsoft.com...
> >I getting invalid syntax with DSUM.
> >
> > I trying to pull an amount from a atable where criteria is the year in
> > txtDate AND the account number is in txtAccount.
> >
> > Both txtDate and txtAccount are on the same form.
> >
> > Here is my DSUM...
> >
> > =DSum("Amount","Deposits","[AccountColumn]="[Me!txtAccount] AND
> > "[DateColumn]="(Year[Me!txtDate])
>
>
>