Also, make sure that the dates are in mm/dd/yyyy, regardless of what your
locale settings are.
If there's a chance that the user's short date format might be dd/mm/yyyy,
change Gerald's suggestion to:
xx = DSum("[Amount]", "tblAllCalls", "[CallingNumber]
= '" & searchnumber & "' AND startdate Between #" &
Format(varbeg, "mm/dd/yyyy") & "# And #" & Format(varend, "mm/dd/yyyy") &
"#")
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)
"Gerald Stanley" <(E-Mail Removed)> wrote in message
news:00ef01c423fa$71e4c230$(E-Mail Removed)...
> Try
>
> xx = DSum("[Amount]", "tblAllCalls", "[CallingNumber]
> = '" & searchnumber & "' AND startdate Between #" &
> varbeg & "# And #" & varend & "#")
>
> Hope This Helps
> Gerald Stanley MCSD
> >-----Original Message-----
> >Can I use the following in a DSUM function:
> >
> >xx = DSum("[Amount]", "tblAllCalls", "[CallingNumber]
> >= '" & searchnumber & "'" AND startdate Between #" &
> >varbeg & "# And #" & varend & "#")
> >
> >For some reason I'm getting a syntax error.
> >tia.
> >.
> >