Home » Developer & Programmer » Forms » How to delete some last record on a non-database block(tabular) (Forms [32 bits] Version 9.0.4.0.19 + WinXP)
How to delete some last record on a non-database block(tabular) [message #401430] Mon, 04 May 2009 23:33 Go to next message
kevin_ye
Messages: 37
Registered: December 2007
Location: Shanghai,China
Member
I have create a tabular layout, and I inserted 4 records in [WHEN-NEW-FORM-INSTANCE], then I created a delete button for testing.

If I choose the last continuous records(2 or more), then I cannot delete the first chosen record.

for example, if I choose the last 2 record(3'rd record and 4'th record), and press delete button, I can only delete the last record, and the third record is still on the block.

Can anyone help me to find the debug? any suggestion appreicated.

[WHEN-BUTTON-PRESSED]
--delete selected stock
go_block('selected_stock_list');
last_record;

loop
  if :system.cursor_record > '1' then
    if :selected_stock_list.marker='X' then
      delete_record;
    end if;	  
    if :system.cursor_record = '1' then
      if :selected_stock_list.marker='X' then
        delete_record;
      end if;	 
      exit;  --reached last record so exit loop
    else
      previous_record;
    end if;
  elsif :system.cursor_record = '1' then
    if :selected_stock_list.marker='X' then
      delete_record;
    end if;	 
    exit;
  end if;
end loop;
--first_record;  

  • Attachment: 4.JPG
    (Size: 26.95KB, Downloaded 555 times)
Re: How to delete some last record on a non-database block(tabular) [message #401431 is a reply to message #401430] Tue, 05 May 2009 00:02 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
After deleting a record send the navigation to first record to start all over again b/c as you delete a record it is removed from the block and as a result records below it come one level up.

Regards,
Azam Khan
Previous Topic: keypress erases everything
Next Topic: Simple Loop does not populate the block correctly
Goto Forum:
  


Current Time: Tue Feb 04 00:00:02 CST 2025