"Maarkr" <(E-Mail Removed)> wrote in message
news:7EFAB8E2-42EA-4B41-88CE-(E-Mail Removed)...
> Trying to do a form filter query to get the query to view records between
> the
> date entered and 15 days later...
>
> strWhere = "shDate= '" & Me.Combo1 & "'"
>
> gives me a simple date filter, but I've struck out trying the parens and
> the
> 'between x AND y ' expression
>
> ?? plain language = between combo1date and combo1date + 15
Is shDate a date/time field? If it is, you really should be using the date
delimiter # instead of the text delimiter ' to surround your date literals.
You also should make sure your date literals are formatted into either US
date format (MM/DD/YYYY) or an unambiguous international standard format.
Try this:
strWhere = _
"shDate Between " & Format(Me.Combo1, "\#mm/dd/yyyy\#") & _
" AND (" & Format(Me.Combo1, "\#mm/dd/yyyy\#") & " + 15)"
That version lets the query processor do the addition. An alternative would
be to add the 15 days yourself:
strWhere = _
"shDate Between " & Format(Me.Combo1, "\#mm/dd/yyyy\#") & _
" AND " & Format(CDate(Me.Combo1) + 15, "\#mm/dd/yyyy\#")
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)