Re: Automatically requery data in forms 4.5
Date: Wed, 10 Mar 1999 14:51:27 +0000
Message-ID: <36E686EF.AFA59643_at_cam.ac.uk>
u08508_at_my-dejanews.com wrote:
>
> I have a form with a single block tabular display.
> First the user must input a criteria and then execute the query.
>
> On this form is a button which when pressed a procedure will delete rows with
> an end date that has passed. I want the form once the rows have been delete
> to requery the current data displayed. I have tried using a predefined where
> clause and also the copy command without much success. Has anybody got any
> ideas on the best way to requery the current information.
If you press the <enter query> key when you are already in enter query mode, it repeats the last query criteria for the block.
The ENTER_QUERY built-in has the same behaviour, but it is a little tricky to exploit. However, the following will do the trick:
In the PRE_FORM trigger:
:global.re_query = 'F';
In the WHEN_NEW_RECORD_INSTANCE trigger for the block:
If :system.mode = 'ENTER-QUERY'
And :global.re_query = 'T'
Then
:global.re_query := 'F'; enter_query; -- repeat last criteria execute_query;
End If;
In the WHEN_BUTTON_PRESSED trigger for you button:
:global.re_query := 'T';
enter_query;
If you hid al this inside a package, you can use an outer level package variable of type BOOLEAN instead of the messy global. Received on Wed Mar 10 1999 - 15:51:27 CET