Home » Developer & Programmer » Forms » Problem with Enter Query and Execute Query forms 6i (forms6i)
Problem with Enter Query and Execute Query forms 6i [message #319520] Mon, 12 May 2008 01:34 Go to next message
rahul15june
Messages: 35
Registered: May 2008
Member
Hi,

I have a content canvas which has a Database block. and a stacked canvas which has a "non" database bock. Now the stacked canvas has a date field along with the check box. (Its multirecord). So when user selects the checkbox then the stacked canvas is hidden and the content canvas database block is made enter query and which ever date value was there in the stacked canvas that is used as a parameter in the content canvas and I want to execute the query programatically.

However, After Enter query, nothing happens in the form and I have to manually enter the value in the form and hit F8 rather than it happening programatically. Here is my code in the stacked canvas when-checkbox-changed trigger.

IF :CB_VIEW = 1 THEN
HIDE_VIEW('DAYSTATS'); -- this is the stacked canvas
GO_BLOCK('EXP_MAIN'); -- This is the database block

CLEAR_BLOCK(NO_VALIDATE);
ENTER_QUERY;

:EXP_MAIN.EXP_DATE := :DAYSTATS.DAYDATE; --Here I am assigning the database block date field with the stacked canvs date value

EXECUTE_QUERY; -- I want to execute the block with the date selected.
:CB_VIEW := 0;
END IF;


All of this should happen automatically without users having to hit F7 or F8 button.

Thanks in advance,
Rahul
Re: Problem with Enter Query and Execute Query forms 6i [message #319553 is a reply to message #319520] Mon, 12 May 2008 03:12 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ENTER_QUERY;

:EXP_MAIN.EXP_DATE := :DAYSTATS.DAYDATE; --Here I am assigning the database block date
                                         --field with the stacked canvs date value

EXECUTE_QUERY; -- I want to execute the block with the date selected.
This can't work because once you enter ENTER_QUERY mode, Forms waits for a search criteria (if any) and EXECUTE_QUERY.

What you could do is to set the DEFAULT_WHERE property (using the SET_BLOCK_PROPERTY built-in) and execute a query. Something like
SET_BLOCK_PROPERTY('exp_main', DEFAULT_WHERE, 'exp_date = ' || :daystats.daydate);
EXECUTE_QUERY;

[Updated on: Mon, 12 May 2008 21:21] by Moderator

Report message to a moderator

Re: Problem with Enter Query and Execute Query forms 6i [message #319559 is a reply to message #319553] Mon, 12 May 2008 03:42 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
I also believe in the logic define by Littlefoot.
Re: Problem with Enter Query and Execute Query forms 6i [message #319561 is a reply to message #319553] Mon, 12 May 2008 03:56 Go to previous message
rahul15june
Messages: 35
Registered: May 2008
Member
You are 100 percent correct little foot. I am not sure, why I ever though of using the enter query option when I already had used a similar funtionality elsewhere in the code! Looks like my brains are still in weekend mode.

Thanks though!
Previous Topic: How to Store Photos in Oracle
Next Topic: Microsoft Out Look (To get Mail Failure)
Goto Forum:
  


Current Time: Sat Dec 03 09:46:53 CST 2016

Total time taken to generate the page: 0.05899 seconds