date and defaultvalue

F

Francesco

Hi,
first of all sorry for my bad english.
i'm using microsoft office italian version
i'm trying to save a defaultvalue in a field. added an event
on"after_update":
fld_date.defaultvalue="#"&format(data.value,"dd/mm/yyyy")&"#"
but it always save date in english format "mm/dd/yyyy"
this is a problem because in the table all datas are in italian format
"dd/mm/yyyy"
how can i solve it ?

many thanks
 
R

RoyVidar

Francesco wrote in message
Hi,
first of all sorry for my bad english.
i'm using microsoft office italian version
i'm trying to save a defaultvalue in a field. added an event
on"after_update":
fld_date.defaultvalue="#"&format(data.value,"dd/mm/yyyy")&"#"
but it always save date in english format "mm/dd/yyyy"
this is a problem because in the table all datas are in italian format
"dd/mm/yyyy"
how can i solve it ?

many thanks

You must assign it so that Access can understand it. That can be for
instance US format or ISO 8601 (see below)

fld_date.defaultvalue= "#" & format(data.value,"yyyy-mm-dd") & "#"

Here's some more info
http://allenbrowne.com/ser-36.html
 
D

Douglas J. Steele

Regardless of what your Short Date format has been set to through Regional
Settings, you must use mm/dd/yyyy format. (Okay, this isn't strictly true:
you can use any unambiguous format, such as yyyy-mm-dd or dd mmm yyyy. The
point is, you can't use dd/mm/yyyy unless it's after the 12th of the month,
in which case Access will realize that the month can't be larger than 12,
and will interpret it correctly). Dates are actually stored as 8 byte
floating point numbers (the integer portion represents the date as the
number of days relative to 30 Dec, 1899, and the decimal portion represents
the time as a fraction of a day), so there won't be a problem with your
existing data.

You might want to read Allen Browne's "International Dates in Access" at
http://allenbrowne.com/ser-36.html
or what I have in my September 2003 Access Answers column for Pinnacle
Publication's "Smart Access" newsletter. (The column and accompanying
database can be downloaded at
http://www.accessmvp.com/djsteele/SmartAccess.html)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top