Date Value Not Correct

  • Thread starter Thread starter Russ
  • Start date Start date
R

Russ

I have this application in which I roll back the 7 hours
after 12 mid night back into the previous day's shift
values using the query function that follows.

dteDate1: DateValue(DateAdd("h",-7,[dteDate]))

Now, I've assigned this new value to a function that is
passed from the active form to the (live) Main Menu form
and called to filter the records returned when reports are
run. The only thing though, is that it does not always
work. Fore example the range may be from June 01, 2003 to
August 31, 2003. But the returned records rune from some
time in April to the last known record created yesterday.
Somehow, the function does not see the value in the Main
Menu control as a Date value that is passed back to
reports underlying query criteria. Any assitance will be
appreciated.
 
Russ,

I have occassionally had problems with queries identifying the date
value in a text box as being a valid date.

When this occurs, I usually put a check in the beforeupdate event of
the textbox to test and make sure the value entered is a valid date.
Then, I use cDate(forms!frmName!txtDate) in my query , to explicitly
change the format of the textbox to a valid date format.

--
HTH

Dale Fye


I have this application in which I roll back the 7 hours
after 12 mid night back into the previous day's shift
values using the query function that follows.

dteDate1: DateValue(DateAdd("h",-7,[dteDate]))

Now, I've assigned this new value to a function that is
passed from the active form to the (live) Main Menu form
and called to filter the records returned when reports are
run. The only thing though, is that it does not always
work. Fore example the range may be from June 01, 2003 to
August 31, 2003. But the returned records rune from some
time in April to the last known record created yesterday.
Somehow, the function does not see the value in the Main
Menu control as a Date value that is passed back to
reports underlying query criteria. Any assitance will be
appreciated.
 
Thanks Dale:

However, I am using a Global function that grabs the date
values from the live Main Menu form and plug it into the
query's criteria. This, is where I get the Data Type
Mismatch Error. At the query level. I will change the
Global functions obtained data with the CDate Function to
see if it helps.

Thanks.
 
Back
Top