Dates with day below ten aren't found with docmd.applyfilter state

G

Graeme

Filter fails: the DoCmd.ApplyFilter , "[Date] =Forms![Games
Today]![ViewDate]" does not work if the ViewDate field has a date selected
where the day value is below 10. Works fine for dates 10 and above.
The filter statement appears to be valid and shows as eg. [Date] =
#02/12/2009# if script is halted. (I wouldn't use date as a field name
nowadays, but this is a very old dbase).
The program was written in access 97 and works fine there. Converted to
MsAccess 2007 that links to an access 97 data file. PC is running windows 7.

When first loaded none of the date filters worked until I reset the computer
short date format to match. Then the two digit dates started working.
Going round the twist with this one!!
If I run a query with a user input and enter the date eg. 02/12/09 it works
fine and same for 2/12/10 etc.
Thanks for any help on this.
 
J

John W. Vinson

Filter fails: the DoCmd.ApplyFilter , "[Date] =Forms![Games
Today]![ViewDate]" does not work if the ViewDate field has a date selected
where the day value is below 10. Works fine for dates 10 and above.
The filter statement appears to be valid and shows as eg. [Date] =
#02/12/2009# if script is halted. (I wouldn't use date as a field name
nowadays, but this is a very old dbase).
The program was written in access 97 and works fine there. Converted to
MsAccess 2007 that links to an access 97 data file. PC is running windows 7.

When first loaded none of the date filters worked until I reset the computer
short date format to match. Then the two digit dates started working.
Going round the twist with this one!!
If I run a query with a user input and enter the date eg. 02/12/09 it works
fine and same for 2/12/10 etc.
Thanks for any help on this.

Especially given that it's a very old database, I wonder if the datatype of
the table field is Text rather than Date/Time?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top