C
Carl Colijn
Hi all,
The date/time fields in my tables do not have any input mask and/or notation
set; I have only set a notation to the corresponding text control on the
bound form. The notation gets set dynamically via VBA to be a custom
format; "d/m/yyyy h:nn" or "m/d/yyyy h:nn", depending on the user's regional
settings.
When the user enters date and time information, it all works well for most
date/time combinations. However, for some date/time combinations, the
display works OK when the user leaves the text control, but when the user
consecutively re-enters the text control, the format changes instantly to
standard date/time notation ("m/d/yyyy h:nn:ss AM/PM"). Such an "expanding"
date looks very weird and I'd like to get rid of it, mostly also because it
only occurs with a fraction of the records.
Some examples:
3/1/2006 13:00 gets expanded to 3/1/2006 1:00:00 PM, but
3/17/2006 13:00 does not get expanded
When I then change the 3/17/2006 to 3/1/2006, the expansion will occur
again.
The way to get this 'feature' to raise it's head (at least, in Access 2003,
Dutch Edition), is:
- create an empty database
- clear the "automatic name corruption" setting
- compact/repair
- create a table with one fields
- set it's type to Date/Time
- keep notation and input mask empty
- save the table
- create a form
- bind it to the above table
- add a text control bound to the date/time field
- keep it's notation and input mask empty
- make the default view of the form continuous (for easier testing)
- add the following VBA to the form's Form_Load event:
Text1.Format = "m/d/yyyy h:nn"
- save the form
- open the form
- enter:
3/17/2006 13:00
- go to another record, and go back to the above one; the format doesn't
change
- enter:
3/1/2006 13:00
- go to another record (again, nothing changes), and go back to the above
one; the content now changes to 3/1/2006 1:00:00 PM
I have searched Google for this behaviour, but came up empty-handed. If
anyone can reproduce this behaviour, then I will at least know it's not only
me seeing this problem. Of course, if someone knows the underlying cause
(or a workaround), that would be even better
Thanks in advance,
Carl Colijn
The date/time fields in my tables do not have any input mask and/or notation
set; I have only set a notation to the corresponding text control on the
bound form. The notation gets set dynamically via VBA to be a custom
format; "d/m/yyyy h:nn" or "m/d/yyyy h:nn", depending on the user's regional
settings.
When the user enters date and time information, it all works well for most
date/time combinations. However, for some date/time combinations, the
display works OK when the user leaves the text control, but when the user
consecutively re-enters the text control, the format changes instantly to
standard date/time notation ("m/d/yyyy h:nn:ss AM/PM"). Such an "expanding"
date looks very weird and I'd like to get rid of it, mostly also because it
only occurs with a fraction of the records.
Some examples:
3/1/2006 13:00 gets expanded to 3/1/2006 1:00:00 PM, but
3/17/2006 13:00 does not get expanded
When I then change the 3/17/2006 to 3/1/2006, the expansion will occur
again.
The way to get this 'feature' to raise it's head (at least, in Access 2003,
Dutch Edition), is:
- create an empty database
- clear the "automatic name corruption" setting
- compact/repair
- create a table with one fields
- set it's type to Date/Time
- keep notation and input mask empty
- save the table
- create a form
- bind it to the above table
- add a text control bound to the date/time field
- keep it's notation and input mask empty
- make the default view of the form continuous (for easier testing)
- add the following VBA to the form's Form_Load event:
Text1.Format = "m/d/yyyy h:nn"
- save the form
- open the form
- enter:
3/17/2006 13:00
- go to another record, and go back to the above one; the format doesn't
change
- enter:
3/1/2006 13:00
- go to another record (again, nothing changes), and go back to the above
one; the content now changes to 3/1/2006 1:00:00 PM
I have searched Google for this behaviour, but came up empty-handed. If
anyone can reproduce this behaviour, then I will at least know it's not only
me seeing this problem. Of course, if someone knows the underlying cause
(or a workaround), that would be even better
Thanks in advance,
Carl Colijn