Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 7th, 2006, 07:41 AM
Authorized User
Join Date: Jun 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Filter form with date fields problem!!

has anybody got an idea how i could filter Access forms using date fields. Don't get me wrong... I know how to use filter but everytime i use it on date fields in Access it returns wrong dates or sometimes doesn't return anything at all.

  I have played with it soo much till now i feel am jus guessing solutions rather than know the solutions. I can't even explain why i don't get data at times and not at other times.

If you have experienced such problems please help!!.

Old August 10th, 2006, 12:34 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Please post some data from the date fields. Access can get freaky when the dates take formats like YYYY-MM-DD, etc. SO if you date fields are not what Access is expecting, it won't return any records, or the wrong records.

One solution I use is to use a combo box to look up the dates as they are formatted, and then use them as strings to get the data filtered.


Old August 14th, 2006, 10:15 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

If you're talking about filtering the date fields via VBA programming just remember to delimit the date variable with pound signs. For example:

Me.Filter = "[dtmDueDate] < #" & Date() & "#"

Also remember not to name any fields in your tables just DATE because that is a reserved Access function that returns today's date.

The function Now() returns the date and current time, so only use that one if time of day matters. If not, comparing a date to Now will rarely match because a date is usually stored with midnight as the time if Now was not used in the first place.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter dataset by Date? spacky001 ASP.NET 2.0 Basics 1 January 23rd, 2007 07:17 PM
comparing date/time fields on form validation Lucy Javascript How-To 1 June 20th, 2006 09:22 AM
How can i filter d repot fields at runtime... nikks9 Crystal Reports 1 June 9th, 2006 05:41 AM
problem with filter form keyvan Classic ASP Databases 1 June 29th, 2003 05:17 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.