putting current time in the text box [message #339703] |
Fri, 08 August 2008 02:56 |
durgadas.menon
Messages: 365 Registered: December 2007 Location: Nowhere
|
Senior Member |
|
|
Hi,
I want to display the current time in a text box (TIME) shown in the attachment. Can you guide me how to do it?
I tired putting code in the WHEN_NEW_INSTANCE trigger but did not know how to proceed
declare
a date := sysdate;
begin
?????
end;
-
Attachment: time.gif
(Size: 61.27KB, Downloaded 465 times)
|
|
|
Re: putting current time in the text box [message #339708 is a reply to message #339703] |
Fri, 08 August 2008 03:13 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Create a text item; its datatype should be DATE, and its "Initial value" property should be $$date$$.
If you insist on PL/SQL solution, put such a line:block_name.text_item := sysdate; into the WHEN-NEW-FORM-INSTANCE trigger.
You don't need to DECLARE anything (as you are trying to).
P.S. Forgot to mention ... there's the "Format Mask" item property which should/might be set to display value accordingly to your needs (for example, dd.mm.yyyy or hh24:mi or ...). If you are going to display TIME, then initial value should be set to $$time$$ (instead of $$date$$). Or, even better, set it to $$datetime$$ and you'll have both date AND time.
[Updated on: Fri, 08 August 2008 03:19] Report message to a moderator
|
|
|
|