Assuming that varDateBeg and varDateEnd are variables, concatenate their
values into the string outside the string:
Set rstin = dbs.OpenRecordset("Select * From tblAllDates Where CallDate
Between #" & varDateBeg & "# And #" & varDateEnd & "#")
--
Ken Snell
<MS ACCESS MVP>
"Linda" <(E-Mail Removed)> wrote in message
news:005301c423ed$e3887a10$(E-Mail Removed)...
> I,m using the following statment to limit my recordset:
>
> Dim vardatebeg, vardateend as variant
>
> Set rstin = dbs.OpenRecordset("Select * From tblAllDates
> Where CallDate Between #varDateBeg# And #varDateEnd#")
>
> When debugging I,m getting the follwing error message:
>
> syntax error in date in query expression.
> Can anyone see what I'm doing wrong here? TIA
>
|