Okay... I am by far no expert when it comes to Oracle Form Builder 6. So please bare with me. I am doing this for a school project and have spent MANY hours pulling my hair out over this. With that said, here I go...

I am making a form that is basically a bill for a Law Firm. Attorneys having billing line items in a history table and a master record in a billing table. In this form I am attempting to make a master-detail relationship where I can show all of this information.

At the top of the form (the bill's header so to speak) I have the information from the billing table (along with two other related tables for attorney names, case description, etc) in its own frame.

In a frame underneath this (the bill's body) I have a tabular datablock showing 10 lines of the history table. The goal is to only show the lines of the history table that match with the case id and whose dates lie between the beginning and ending dates in the header.

To use the form, I have set up a couple of LOVs to get the header info filled in. Up to that point, all is well. My problem occurs with trying to get Form Builder to automatically fill in the detail lines of the bill after having filled in the header.

The only thing that seems to work at all is if I click on the Forms Runtime 'Enter Query' button... then use my LOVs... then click on the 'Execute Query' button. This works, but I do not want to use the default buttons and for some reason doing this causes Forms Runtime to ask me if I want to save... twice... in a row? Its kind of weird.

Now, I have been attempting to use smart triggers to use some pl\sql code to get the lines of the detail block filled in, but I run into the ORA-01422 error. However, if the bill header will only be returning one detail line, the error does not occur. I assume this is because the select query returns multiple lines and I do not know how to specify that I want the next line of the detail block filled in and so on...

Is that possible? How can I get Form Builder to fill in the detail block's values without having to use the 'enter/execute query' buttons? Any help will be greatly appreciated! Thanks.