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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-block forms and saving

Status
Not open for further replies.

vsimmons

Programmer
Jun 15, 2002
9
US
Hi All,
I have a question that is probably an easy one to answer, but I've never done it myself so I'm not sure how...

I have a form that has 3 data blocks (2 of them are based on tables and the 3rd is a control block with buttons and display fields). I wanted to know how I can click on a SAVE button (in the control block) and have it only commit the data that was entered in one of the other two data blocks. The two data blocks are not related in a master-detail way - the first block is only used to query and populate a value that is in the second data block.

Any help would be appreciated.
Thanks!
 
Commit_Form built-in saves your changes to the database. Of course only in your second data block records can be inserted and updated (block and item properties Insert Allowed and Update Allowed).

I hope this will help you.

Helena
 
Hi Helena,

I tried to change those properties as you suggested, but then when I went to type information into the fields for the master block, it wouldn't let me because insert/update is not allowed. I don't want the user to have to "query up" this information - I want them to enter it on the form and I will perform validation against that table in the background. Is this possible?

Thanks!
Vanessa
 
There can be a block with insert/update allowed = yes and all it's items are insert/update allowed = no.
You can perform validation also in Pre-Insert and Pre-Update triggers, I use this method.

Helena
 
I am sorry this will not work - There can be a block with insert/update allowed = yes and all it's items are insert/update allowed = no.
 
If you don't need to store data from master block, why don't you make it "control" one (not based on any table at all)? Regards, Dima
 
Since oracle saves all changes to database in all blocks, I think the best way is using database blocks and non-database blocks at the same time. If two datablocks are visible at the same time and if they don't related to each other and only one of them will be used to insert and update data, that block should be database block. The other block can be non database block, which require more coding sometimes but it is safer.

I also use insert-update allow property of the block, but sometimes locks other blocks visible.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top