Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defaulting to the 31 Dec of the current year 1

Status
Not open for further replies.

McLiguori

Technical User
Mar 27, 2003
90
IT
I have a form in which I want one of my controls (a date control) to default to 31-Dec-Current Year.

I have managed to do this and it works well. In the control's properties I have:

Default Value: 31 & "-" & "Dec-" & DatePart("yyyy",Now())
Input Mask: 00\->L<LL\-0000;0;_

Format: dd-mmm-yyyy

However, the database needs to be used by computers set to English and Italian.

The above works perfectly on the computers set for English. But I get an error (when using that date as a parameter for a report) because in Italian the 3 letter abbreviation for December is "Dic" not "Dec".

Is there a default value I can use that will default to 31-Dec-Current Year on the English Machines and 31-Dic-Current Year on the Italian machines.

Access converts all the programming perfectly and it works fine in both languages except this because the default is a manually entered "Dec" or "Dic" rather than programatic such as the DatePart("yyyy",Now()) part which works well in any language.

Thanks for any help you can give me.

McLiguori
 
Dic or Dec should be a format issue, why not use a real date as the default value and format it for the various countries? For example:

Default Value: DateSerial(Year(Date()),12,31)
Fornmat: Long Date

Choosing a built-in format from Windows Regional settings means that the date will appear in the expected format for each PC.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top