Re: Forms 3.0 Requery master block question

From: <morleb_at_cbr.hhcs.gov.au>
Date: 3 Feb 95 10:27:34 +1000
Message-ID: <1995Feb3.102734.1_at_cbr.hhcs.gov.au>


In article <3gql0k$363_at_newsbf02.news.aol.com>, rdearth_at_aol.com (RDearth) writes:
> This is my Forms 3.0 question: After an amount in the detail block is
> updated, I want to be able to requery the master block containing the
> total amount and have it reflect the change.
>
> I tried several approaches which always brought the cursor to the first
> record instead of the current record. It seems as though the cursor loses
> its position. I tried the following and it did not work; I saved the
> primary key, then execute query, then moved the primary key back. This
> did not work. I don't know what programming technique to use on this
> problem.

If you want to retrieve the same set of records and display the one you were working on, try the following code after the query is executed:

	while :primary_key_field != saved_key_value loop
          if :SYSTEM.LAST_RECORD = 'TRUE' then
            message('ERROR');
            exit;
          else
            next_record;
          end if;
        end loop;

If you only want to retrieve the one record you were working on, put the following code in the PRE-QUERY trigger for the block:

        :primary_key_field := saved_key_value;



Brian Morley morleb_at_cbr.hhcs.gov.au Dept Human Service & Health, Brisbane, Australia Received on Fri Feb 03 1995 - 01:27:34 CET

Original text of this message