Re: Problems with Date Field

From: Jerry Alan Braga <jabraga_at_golden.net>
Date: Wed, 17 Nov 1999 11:27:47 -0500
Message-ID: <80ul5q$k8s$1_at_cougar.golden.net>


Why, why, why are you doing it this way.

Is it because of entry / output formatting this is an easier way.

Create the following registry entries (String values)

under the key

HKEY_LOCAL_MACHINE\Software\Oracle

Entry: FORMS50_USER_DATE_FORMAT
Value: MMDDRRRR (or whatever mask you want we you this for Y2K 2 digit year entry)

Entry: FORMS50_OUTPUT_DATE_FORMAT
Value: DD-MON-YYYY (or whatever mask you want)

Entry: FORMS50_ERROR_DATE_FORMAT
Value: MMDDRRRR (or whatever mask you want we match it to the USER_DATE_FORMAT) The settings are automatically read by Forms and allow the following

FORMS_USER_DATE_FORMAT is the format that the user will type FORMS_OUTPUT_DATE_FORMAT is the format that will be displayed after the user accepts the input
FORMS_ERROR_DATE_FORMAT is the format that will display in error if the user does not enter the right format.

This way you can keep your dates to a single text box and allow the registry settings to work. I had the same problem as you at one time but I did a little digging and found this undocumented settings on the release notes of 5.0 on the support www site.

Scott Haley wrote in message <3832CD64.CA5E7089_at_pilot.msu.edu>...
>I'm working in Forms 5.0 and I'm having a problem with a data field.
>The way the system is set up the users enter the each part of the date
>(month, day, year) into separate textboxes. The text boxes have the
>autoskip property set to yes, this is the way the users wanted it. On
>the post text event of the year field I concatenate these together in
>the DD-MON-YYYY format and then try and stuff them into the event_date
>text box. But I keep getting an error (ORA-01830), I put my code below
>which constructs the correct date format from the three fields. Any
>help would be greatly appreciated.
>
>DECLARE
>
> V_MONTHNUM NUMBER(2);
> V_MONTHTXT CHAR(3);
> V_DAY NUMBER(2);
> V_YEAR NUMBER(4);
> V_DATE VARCHAR2(11);
>
>BEGIN
>
> V_MONTHNUM := :REQUEST_LINEITEMS.TXTMONTH;
> V_DAY := :REQUEST_LINEITEMS.TXTDAY;
> V_YEAR := :REQUEST_LINEITEMS.TXTYEAR;
>
> V_MONTHTXT := REMIT_PROC.MONTH_TEXT(V_MONTHNUM);
>
> V_DATE := V_DAY || '-' || V_MONTHTXT || '-' || V_YEAR;
>
> :REQUEST_LINEITEMS.EVENT_DATE := TO_DATE(RTRIM(LTRIM(V_DATE)));
>
>EXCEPTION
> WHEN OTHERS THEN
> MESSAGE (ERROR_TEXT);
>
>END;
>
>Thanks in advance,
>Scott
>
Received on Wed Nov 17 1999 - 17:27:47 CET

Original text of this message