Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms design

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a requirement to design forms that has several blocks but those blocks will look like one screen.
My question is it there a way to pull one particular record without filling up the entire screen with records.
Example, if I have emp block, dept block, sal block.
It would look like this:

emp_id Emp_Name

sal_id Salary

dept_id dept_name.

How would I just enter em_id and pull only empname
and then nvigate to enter sal_id, hit enter and pull salary.
Is there something like on-enter trigger that will pull up each description as soon as that blocks specific id is entered?

Please help me here because my life on the line here because I have designed and it turns out that I spent 3 months designing wrong application.
thanks in advance
 
In each ID field create a WHEN-VALIDATE-ITEM trigger. In that trigger SELECT the description from the relevant table.

Dont forget to trap for NO_DATA_FOUND. I assume each ID will be unique in the table.
 
thanks lewisp.
The application was designed to accept duplicate values.
 
In that case, you need to decide which of the values you want to display automatically when you enter the ID.

The way to avoid TOO_MANY_ROWS exception is to use an explicit cursor. In your WHEN-VALIDATE-ITEM trigger, use OPEN and FETCH to read the description.
 
thanks again lewisp!
I have two items:
item_id and item_desc.
what I really would like is to enter item_id and have it display both item id and item_desc.
What is happening is when I enter Item_id and hit execute, it displays both item id and item_desc. This is what I want.
Here is where problems come in.
Not only does it display item_id and item_desc which belong to the master block, it also displays the info from detail block.
I believe this is happening because of the defined relationship between them.
I have deleted that relationship but the item_id from master block populates the detail block:
Here is the code that I wrote:
declare
cursor opname is
select mist_operator.mo_operator_id, mist_operator.mo_operator_desc
from operate (this is the master block)
where operate.operate_id = :eek:perate.operate_id;
begin
open opname;
loop
fetch opname into
:call_operate_id, (this :call is the detail block)
:eek:perate.operate_desc;
end loop;

exception
when too_many_rows then null;
end;

can you help please?
 
tankem, it sounds like you still have the ON-POPULATE-DETAILS trigger(s) still hanging around in your master block(s). Remove these and it should stop the automatic population of the details block.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top