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

define current record in data block....

Status
Not open for further replies.

vpv

Programmer
Oct 30, 2003
24
RU
On the form i've got data block as tabular list.
I want delete record and then to stay on the next record...
go_block('card_cnt');
n_rec:=to_number:)system.trigger_record);
delete from card_cnt where id:=:card_cnt.id;
clear_block(NO_VALIDATE);
execute_query;
go_record(n_rec);

but n_rec always equal 1.
:system.cursor_record also equal 1.
Why? May be exist another way?
 
You havent actually navigated to a record after the go_block, so your trigger record will be 1.

You then delete a record where the ID = ID of current record, which is the first one. You are not deleting a record from the form, you are doing it in the database then querying back the results.

How exactly do you want to delete a record, and what trigger are you calling this code from? You need to examine how you intend to control the delete. If you navigate to a record, then DELETE_RECORD, the cursor will stay on the next record down. You can then commit your changes without the need to re-query or move the cursor.
 
sorry, i make this operation first time (...not enough experience). How i can perform this operation correct?
if only i see any example...
thanks.
 
You can simply move the cursor to the record you want to delete and press the DELETE RECORD button. Then to commit your changes, press the COMMIT button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top