Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2006, 07:52 AM
Authorized User
 
Join Date: Feb 2006
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!

Scripts82
__________________
Scripts82
 
Old March 13th, 2006, 03:47 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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.

HTH

mmcdonal
 
Old March 13th, 2006, 09:36 PM
Authorized User
 
Join Date: Feb 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!

Scripts82





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.