Doug Barnes
doug at starntech.com
Wed Oct 21 14:42:39 CDT 2009
What if you just entered the day "21" and re-format that to currentMonth/21/currentYear? Douglas Barnes Starn Technical Services P.O. Box 1172 1057 French Street Meadville, PA 16335 P: 814.724.1045 F: 814.337.3460 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Robert Sent: Wednesday, October 21, 2009 3:18 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] All-In-One Date format Function: Thanks for the reply Lambert, The great thing is, I don't have to worry about in what order the date is entered. Currently all dates are entered in "09/21/09" format. The request is "we would like to minimum keystrokes (see below) and have the users enter the date as 0909 for CC and 092109 for all other date fields. (I want to parse the date and format it correctly to protect against 909 or 32109.. etc entries... The owner want the fastest possible key entry to his employees. Reaching for a mouse is not an option here..;-) Even if I did have to worry about the date order, I should be able to format the end entry to the system formatting very easily right?, it's the parsing that's the challenge.. :-) Thanks Again WBR Robert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, October 21, 2009 2:49 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] All-In-One Date format Function: Robert, If you would like to remain sane they I suggest you step away from the problem. "I would like the user to enter it the way they want to" is just not a good idea. What if your company hires a Brit who wants to enter 10/1/09 - meaning January 10th 2009? Or a Japanese who enters 10/01/09 but means January 9th 2010? To me, the simplest solution to managing date input is to not permit freeform entry, but rather to pop up a small calendar form any time a Date field is clicked on. As for a routine to convert existing freeform dates? I don't think you can beat Cdate([YourData]) Cdate can handle just about anything that looks like a date and if it's unambiguous will give you a real date back. It will of course assume mm/dd/yyyy when the input data is not clear. Just another reason NOT to allow freeform date entry. Feed it really weird input like 92109 and you will get back 3/7/2152, because that date is 92,109 days after 12/30/1899 - the basis of Access dates. Doing any better than this is going to require various assumptions to be coded regarding what comes first a month a day or a year. Why have the problem to deal with? Use a calendar form. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Robert Sent: Wednesday, October 21, 2009 2:17 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] All-In-One Date format Function: Hoooooowdy, Before re-inventing the wheel here, does anyone have or know of a function that can handle "free form" date formatting. I'm looking for a function that can parse any input and then format is correctly. Example of user inputs: 0909 09/21/09 09-21-09 092109 92109 9212009 etc. I don't want to use any formatting / Masking settings at the field or table level. I would like the user to enter it the way they want to (to the most degree possible)... WBR Robert -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com