Date in field is wrong

access2010

Registered User.
Local time
Yesterday, 23:53
Joined
Dec 26, 2009
Messages
1,115
Up until to-day, the date entry was always correct

We use a Macro SendKeys; =Format$(Date(),"yy mmm dd")
Wait; No

The Field Format is; yyyy mmm dd
I also tried the Field Format as; yy mmm dd
Using the macro for either format the entry appears as; 21 Apr 04

When we leave the field the entry appears as; 2004 Apr 21

The Windows 10 date reads; 4/4/2021

Can I please have a suggestion how to fix this problem, which for the FIRST time appeared to-day?

Thank you
Nicole
 
Code:
Format$(Date(),"yy mmm dd")

I think that code confuse access sometimes. This should work.

Format$(Date(),"yyyy mmm dd")
 
i suggest use the Default value of the textbox instead of Macro.

Default Value: =Date()

Format only applies to the field/text Display.
 
Thank you both for your assistance, we have decided to use; Format$(Date(),"yyyy mmm dd").
What I do not understand our previous Macro worked for YEARS.

I do appreciate your help.
Nicole

 
if you try to just declare a date in a module

const mydate= #21 Apr 04#
The date changes to #4/21/2004# (which is 2004 Apr 21, as in your original post)

It's trying its best to work out which date you mean from incomplete information
Try different dates to see what happens. Note that this is US date format mm/dd/yyyy
If you are in the UK, it's possibly even less clear what you will end up with.

I am not sure what answers you got previously. Try different date values to see.
 
Last edited:
We thank you all for your suggestions.
We have decided to use our macro
=Format$(Date(),"yyyy mmm dd")

Crystal
 

Users who are viewing this thread

Back
Top Bottom