Converting 2 digit Year to 4 digit in Forms 4.5

From: michael ringbo <mri_at_dde-nospam.dk>
Date: Thu, 24 Sep 1998 13:45:54 +0200
Message-ID: <360A30F2.33C61639_at_dde-nospam.dk>



[Quoted] Hi All

I run my Forms with the format mask DD.MM.YYYY. But I want the users to input the year with two-digits. In that situation Forms automatically expands the year to four digits. If the input year is 98 it's expanded to 0098. I catch this situation, when the cursor leaves the field, in a WHEN-VALIDATE-ITEM trigger and re-expand the input to 1998 or 20XX by calling af procedure that based upon a 30/70 year rule finds out if it's the 20. or the 21. century. Works just fine.

The problem arises when the user gives the the input '00'. This situation is caught by Forms before I get to the WHEN-VALIDATE-ITEM trigger. The user is given the error: FRM-40209: Field must be of form DD.MM.YYYY'. Alternatively if I just use the standard date format of my database (whish is the same), the user gets the error: FRM-50003: Year must be 00-99 or 1000-4712. This on seems to be totally non-sense since 00 is between 00 and 99, and the year 0872 (for example) is accepted.

I can catch the input-error in the ON-ERROR trigger, and call my re-expanding procedure from there. But then I still have the problem that the cursor doesn't move out of the field. Probably because a raised form_trigger_failure.

Can I get around some way? (I DON'T wan't to skip the date type and use a varchar2 instead)

--
to reply, remove the  "-nospam" from the address
Received on Thu Sep 24 1998 - 13:45:54 CEST

Original text of this message