p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: Access Project Filter by Form


Message #1 by "Tom Abel" <tabel@u...> on Tue, 11 Jun 2002 17:18:35
In an Access Project (not an mdb), the Filter by Form does not appear to 
work for date ranges.  In other words, it is not possible to use ">" 
or "<" or "between" as you can for an mdb.  You can filter for an exact 
date, but this is next to worthless because people are always searching 
for date ranges, not specific dates.
Is this right, and is there any workaround???  Thanks!!!!!!
Message #2 by "Amy Wyatt" <amyw@c...> on Wed, 12 Jun 2002 18:18:08
It is in the way the database is looking at the date field. With SQL2000 
dates have to be converted to be compared so the Filter by Form that is 
built into Access has a conflict when you try to use camparison operators 
with the date. I would suggest setting up a form or even just two text 
boxes on the form for a user to enter dates or date ranges and then use a 
command button or the Events of the controls to apply the filter directly 
to the form's filter property. That way you can apply the correct syntax 
and it will do the job you want it to do.

To see what I mean about the syntax and convertion of dates, create a view 
with criteria of > 1/1/02 (for example) and then view the SQL of the View 
and you will see that SQL will ad the appropriate Convert statement to the 
Where statement of the View.

Hope this helps,

Amy

> In an Access Project (not an mdb), the Filter by Form does not appear to 
w> ork for date ranges.  In other words, it is not possible to use ">" 
o> r "<" or "between" as you can for an mdb.  You can filter for an exact 
d> ate, but this is next to worthless because people are always searching 
f> or date ranges, not specific dates.
I> s this right, and is there any workaround???  Thanks!!!!!!

  Return to Index