J
jfp
On my Win 2000 system, (Control Panel / Regional) i have the short date
format set to "yyyy-MM-dd" (This is one of the standard choices). So,
for example, today will appear as "2003-12-03" instead of the more
traditional "12/3/2003"
On a form i have an unbound control with format set to "Short date". In
the BeforeUpdate method, i call a validation function to make sure that
the value entered is not later than today (using the Date function).
If i type "2/22/2003" into the control:
Access correctly interprets date as Feb 22,
the validation function is satisfied,
Access reformats the date as "2003-02-22" to conform with my settings,
and that is what appears.
All this is good.
Now, if i type "2003-02-22" into the control, things are still OK.
But, if i programmatically put this into the control,
Access somehow interprets it as some date later than today and the
validation function gives me an error.
(In the code, i remember the previous value of a control and
subsequently reload the control with that saved string. Since Access
reformatted the date for me, the string i save is in the yyyy-MM-dd
format; when i set the textbox value to the saved string, that is what i
get. When i subsequently call the validation function, it cannot
interpret the string properly.)
Any ideas ?
format set to "yyyy-MM-dd" (This is one of the standard choices). So,
for example, today will appear as "2003-12-03" instead of the more
traditional "12/3/2003"
On a form i have an unbound control with format set to "Short date". In
the BeforeUpdate method, i call a validation function to make sure that
the value entered is not later than today (using the Date function).
If i type "2/22/2003" into the control:
Access correctly interprets date as Feb 22,
the validation function is satisfied,
Access reformats the date as "2003-02-22" to conform with my settings,
and that is what appears.
All this is good.
Now, if i type "2003-02-22" into the control, things are still OK.
But, if i programmatically put this into the control,
Access somehow interprets it as some date later than today and the
validation function gives me an error.
(In the code, i remember the previous value of a control and
subsequently reload the control with that saved string. Since Access
reformatted the date for me, the string i save is in the yyyy-MM-dd
format; when i set the textbox value to the saved string, that is what i
get. When i subsequently call the validation function, it cannot
interpret the string properly.)
Any ideas ?