Home » Developer & Programmer » Forms » putting current time in the text box (10g Application Server win xp)
putting current time in the text box [message #339703] Fri, 08 August 2008 02:56 Go to next message
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 Go to previous messageGo to next message
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

Re: putting current time in the text box [message #339720 is a reply to message #339708] Fri, 08 August 2008 03:57 Go to previous message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Thanks, it worked fine..
Previous Topic: jfreecharts integration with forms
Next Topic: Problem setting Mater Detail relation
Goto Forum:
  


Current Time: Fri Sep 27 16:20:07 CDT 2024