Quote:on Apr 21st, 2004, 6:28pm, jyellis wrote:
How would you fix this data entry problem? I want them to be able to enter a two digit year like 4/4/59 and it return 4/4/1959
My guess would be an "element on exit" command, right?
Yes, I agree, whatever you decide for format or programming content would be best applied on "element on exit". But I would also suggest that you make that formula a global function to be called when needed vs. entering all that code into every date field "element on exit"
My experience with end users is that you can insist on certain data entry rules all you want, but if your program is not designed to force accuracy, you won't get it. You also want the users to be able to work in the easiest and most natural process.
Here are two routines from some Q&A databases set up to control Y2K formats:
===========================
This routine warns that an early date has been entered,b ut allows operator to continue or go back and reenter. This usually results from entering 2 digit years.
On Exit Program:
IF @YEAR(Date) < 1984 THEN {
@PLAY("BEEP");
@MSGBOX(" = = = CAUTION = = = ",
+@MID(Date,6,5) + "/" + @LEFT(Date,4)+ " MAY be using the wrong year?",
"Enter years with 4 digits");
}
===========================
This routine changes the date automatically, no notification to user, just makes it happen. It just adds 100 years worth of days to the date calculated by the program.
On Exit Program:
If Date < "01/01/1984" Then {Date = Date + 36525}
============================
If you use a variation of these in Sesame, then you can also make the toggle date a global variable also. rather then being "hard-coded" you could use a formula like Sesame is using to keep it 40 years from the current year, or maybe change it to only 20 years instead.
Also note that @PLAY("BEEP") may not work in Sesame on your particular system.