Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old March 13th, 2006, 06:52 AM
Authorized User
Join Date: Feb 2006
Location: , , Singapore.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date Format Problem

Hi all,
In the current mde access application that I have created,
I am facing some problem with the date field.

When the program is ported to different computers, the date format is creating problem. I am not referring to the simple DD/MM/YY or MM/DD/YY format problem. My problem lies in the "language" of the system.

For example: I have a text box that only accepts date.
The format I am expecting is the Medium date format ==> dd-mmm-yy
i.e. 02 march 2006 ==> 02-Mar-06

BUT, when I bring the program over to a PC with the native language set to "German (Germany)", entering 02-Mar-06 will result in an error. And the only way i can enter the date is to enter it using the german short form for March ==> Mrz ==> 02-Mrz-06

My question is: How can I force the program to follow a stipulated date format? This is crucial because I make use of date groupings to perform calculation and I don't want Mar and Mrz to cause me problems and crash my program.

Any help is greatly appreciate!
Thanks in advance!

Reply With Quote
  #2 (permalink)  
Old March 13th, 2006, 02:47 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

The only way to do this is to use a text field, perhps with an input mask that you create - not a date input mask. Since the Date field refers to the system date and time formats (like currency does) it will always default to that local format.

If you use a text field with data validation that you create, you can do this. The coding for your date calculations may be a little difficult, but it is doable this way.


Reply With Quote
  #3 (permalink)  
Old March 13th, 2006, 08:36 PM
Authorized User
Join Date: Feb 2006
Location: , , Singapore.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts

Hmm... ok... that was the last thing on my mind...
Will do some experiments with the dates first before deciding whether to change it. Thanks mmcdonal!

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date format problem abhishekkashyap27 C# 2005 1 June 23rd, 2008 02:25 AM
Date Format Problem cyberddindia Classic ASP Basics 2 October 23rd, 2006 01:49 AM
Date format problem ERC Crystal Reports 1 June 15th, 2005 04:03 AM
Date format problem widad Classic ASP Basics 1 October 15th, 2004 06:31 PM
Date Format problem in Oracle ppenn Oracle ASP 1 May 10th, 2004 06:00 PM

All times are GMT -4. The time now is 03:13 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.