Question : Forms 6.0- how do I set values for a radio button?

I have two tables

MASTER1
 account varchar2(10)
 name    varchar2(3)

DETAIL1
 account varchar2(10
 account_type varchar2(1)


Also have 3 radio buttons together in one radio group.

WHAT I WANT TO DO:

user queries a MASTER1 record.
then it gets the matching DEATIL1 record.
then if account_type = 'A', it sets radio_button1 to 'on'
     if account_type = 'B', it sets radio_button2 to 'on'
     if account_type = 'C', it sets radio_button3 to 'ON'

QUESTION: what is the trigger or sub_program i need ot use to do this?

Answer : Forms 6.0- how do I set values for a radio button?

user queries a MASTER1 record.
then it gets the matching DEATIL1 record.
then if account_type = 'A', it sets radio_button1 to 'on'
    if account_type = 'B', it sets radio_button2 to 'on'
    if account_type = 'C', it sets radio_button3 to 'ON'

CASE 1:
Your radio group is BOUND to a database column (probably called "account_type"
--------------------------------------------------------

Your radio buttons will AUTOMATICALLY set themselves.



CASE 2:
Your radio group is UNBOUND, and you wish to manually control them.  Let's assume you're doing query-only processing at this point.
--------------------------------------------------------
Step 1:

Ensure that the individual buttons in the group have the same values as the database column,eg: 'A' for the database column value 'A', and ensure that the group is set to accept character data.

In a post-query trigger of the Detail1 block, put this code:

  BEGIN
    -- Don't do any processing here that requires saving the results to the database.
    :DETAIL1.MyRadioGroup := :DETAIL1.ACCOUNT_TYPE;
    -- we've just dirtied the record, and Oracle will try to update the database record.  Fix this below
    SET_RECORD_PROPERTY(:SYSTEM.CURRENT_RECORD,'DETAIL1',STATUS,'QUERY_STATUS');
 -- Do any other processing which dirties the record and requires changes to be saved below:


  END;


Random Solutions  
 
programming4us programming4us