Re: FORMS: See Current Record

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/07/21
Message-ID: <snhu1hq96tt41_at_corp.supernews.com>#1/1


"NMU User" <USER_at_NMU.EDU> wrote in message news:8laof6$2knu$1_at_walter.acs.nmu.edu...
> Hi all,
> I am new to Oracle forms and in the middle of developing a small application
> that only incorporates 2 tables. My master data block has a SSN and Name
> Field. My Detail Table is SSN and A 3 digit code the user will enter.
>
> I want the following to occur:
> When the user types in the SSN --> I want the name and all codes from the
> detail to show up on the screen and be ready for more detail records to be
> added (I have 10 details showing at a time).
>
> When the SSN is one that has not been entered before, it needs to be ready
> for the user to type in the new data.
>
> I can't seem to get this to go because what I wanted to do was an
> execute_query in the when_validate_item of the SSN. Execute query is
> apparently not allowed here.
>
> Sample layout:
>
> SSN 999-99-9999
> Name XXXXXXXXXXX
> Codes
> 999
> 999
> 999
> 999 etc...
>
> Thanks in advance,
> -Brian

Your SSN, if it's driving the query in the manner you are describing, cannot be in the same block as the detail block and execute a query at the same time in the same block.

Put your SSN in it's own "control" block. Using NEXT and NEXT_BLOCK triggers, do a go_block(<detail block>) and then do an execute_query. Make sure your where clause for the detail block says:

SSN = :control_block.SSN

After you do the go_block and the execute_query, your detail block will query all records where the SSN matches what you entered in control_block.SSN. Otherwise it'll be sitting on a new (empty) record in the DETAIL block, it'll tell you "Query caused no records to be retrieved." and you'll be ready to start entering a new record.

You don't even need to show the actual database field in your detail block. Keep it non-visible and set the "synchronize with item" property to point to your control_block.SSN and you should be good to go.

-Matt Received on Fri Jul 21 2000 - 00:00:00 CEST

Original text of this message