Date format

kadara

Registered User.
Local time
Today, 11:17
Joined
Jun 19, 2010
Messages
43
I have a Date/Time Picker on a form. The system date format is dd.mm.yyyy (short date). How could I change it (without changing the system date format) in dd/mm/yyyy ?
I tried the Format(DTPicker1, "dd/mm/yyyy") without any effects.

Thanks.
 
On the Property Sheet for the control, go to the OTHER tab, click Custom and change it in the Custom Format box and remember to change the Format drop-down to CUSTOM too.

Welcome to AWF
 
I set up the custom format in dd/mm/yyyy and selected the Custom in the Format drop-down, but the value remains the same as the System date format (dd.mm.yyyy). (See atached files)

Thanks
 

Attachments

  • Clipboard05.jpg
    Clipboard05.jpg
    56.3 KB · Views: 99
  • Clipboard08.jpg
    Clipboard08.jpg
    94 KB · Views: 93
Try dropping a new Date/Time Picker control and changing the format on that one.
 
There is the same probleme with the new Picker. The picker show the date in the custom format, but when I use the value of the picker, its format remains unchanged.
 
A format property affects the visual representation of the data, it doesn't change the value that is returned. So if you want to format the value you need to use the Format() function as well.
 
Try: -

Format(DTPicker1, "dd\/mm\/yyyy")

In the Format function the forward slash is actually a replacement marker.
When the forward slash is used by itself Access (Windows?) looks in regional settings and gets the date separator.
In your case the date separator is a period and so that is the way it is formatted.

By adding the back slash before the forward slash it forces the Format function to take the forward slash as a literal.
 
Thanks.
The Format(DTPicker1, "dd\/mm\/yyyy") is working great.
 
There you go. Chris to the rescue :)

Glad it's working as expected.
 

Users who are viewing this thread

Back
Top Bottom