hoew to control one item from another one [message #308760] |
Tue, 25 March 2008 06:42  |
sagar002100
Messages: 12 Registered: March 2008
|
Junior Member |
|
|
hi,
i have made a table called "reg".. in that form there are two columns ..one is emergency and another is rate..
i just want that when i select emergency to yes then automatically rate feild should show "300".. and when i select no to emergency then rate should be "0"..
brother i have another problem..!! can u solve it?
How to make a field activated based on the value of the other field?
e.g. I have 1 field call 'charge'(to be activated) and another field "emergency" which has 2 values viz 'yes' and 'no'. If 'yes' is been selected the charge field should display a fix amount e.g 500 otherwise when "no" is selected ,field should be deactivated and should display 0.
so can u help me out? Plz..
[EDITED by LF: added the second part of the question as a copy from another thread. Please, do not span your questions all over the forum]
[Updated on: Fri, 28 March 2008 00:46] by Moderator Report message to a moderator
|
|
|
Re: hoew to control one item from another one [message #308775 is a reply to message #308760] |
Tue, 25 March 2008 07:09   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Use DECODE; here's an SQL*Plus example:SQL> select decode('&emergency', 'y', 300, 'n', 0) rate from dual;
Enter value for emergency: y
RATE
----------
300
SQL> /
Enter value for emergency: n
RATE
----------
0
SQL> Hint: Forms trigger will look likeselect decode(:block.emergency, 'y', 300, 'n', 0) from dual; Which trigger? Could be more than one choice. POST-QUERY, WHEN-VALIDATE-ITEM, ... You choose.
By the way, which value do you want to have when user enters something different from Y and N?
|
|
|
Re: how to put background image in form [message #309576 is a reply to message #308760] |
Thu, 27 March 2008 23:40  |
 |
azamkhan
Messages: 557 Registered: August 2005
|
Senior Member |
|
|
ok you can do this on the EMERGENCY list item on WHEN LIST CHANGED if yes then set the properties ENABLED, NO UPDATE ALLOWED to TRUE of the CHARGES item else if EMERGENCY list item is NO then set the properties of CHARGES item to DISABLED.
Regards,
Azam Khan
|
|
|