Re: Date Format Mask Question on Forms5
Date: Wed, 15 Dec 1999 00:09:06 GMT
Message-ID: <836m70$uh9$1_at_nnrp1.deja.com>
Adri,
[Quoted] Yes, but it's a little round-about, hope you can follow this
- create a non-database date item in the same block, I'll call it DUMMY, place it just above your date item in the Object Navigator.
- set DUMMY's format mask to 'DDMMYYYY'.
- in the layout editor, make DUMMY the same size as your date item and superimpose it over the date item.
- set your actual date's Visible property NO and its Autoskip property to YES, DUMMY's visible property YES
- In a form level WHEN-NEW-FORM-INSTANCE trigger, SET_ITEM_PROPERTY('BLOCK.DUMMY',VISIBLE,PROPERTY_TRUE); SET_ITEM_PROPERTY('BLOCK.DATE',VISIBLE,PROPERTY_FALSE);
- In a item level POST-TEXT_ITEM trigger on DUMMY, :block.date := substr(:block.dummy,1,2) || '/' || substr (:block.dummy,3,2) || '/' || substr(:block.dummy,5,4); SET_ITEM_PROPERTY('BLOCK.DUMMY',VISIBLE,PROPERTY_FALSE); SET_ITEM_PROPERTY('BLOCK.DATE',VISIBLE,PROPERTY_TRUE); :block.dummy := NULL; GO_ITEM('BLOCK.DATE');
Paul
}Adri,
Yes but it's a little round-about, hope you can follow this
1. create a non-database date item in the same block, I'll call it
DUMMY, place it just above your date item in the Object Navigator.
2. set DUMMY's format mask to
In article <836910$t8g$1_at_ctb-nnrp1.saix.net>,
"AH ROBERTS" <a3roberts_at_yebo.co.za> wrote:
> Hi folks,
>
> I have an date item on a form. Format Mask property is set to
DD/MM/YYYY.
> Maximum length is 10.
> If you enter the date 13/10/1999 or 13 10 1999 or 13.10.1999 it
changes the
> date to 13/10/1999.
>
> Is it possible to set the format mask to a value which will allow the
user
> to enter 13101999? The date must then be automatically formatted with
the
> '/' in between. (user request)
> The result of above input is 13/01/0099.
>
> I have tried the following DD"/"MM"/"YYYY and DDFM/MMFM/YYYY.
> Basically it gives the same incorrect output.
>
> I tried to manipulate the date in the 'When Validate Item' trigger ,
but for
> the follwing example 13121999, you get the error message 'Day of the
month
> must be between 1 and 12', because it takes 21 as the month value.
> Is it possible to write code in some trigger which will fire before
the
> error message from the format error is shown?
>
> Any suggestions or help will be appreciated!
> Thanks,
> Adri
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Dec 15 1999 - 01:09:06 CET