There are a couple of ways you could speed up this process.
Option 1, you could use a hidden data block and when your user selects the CheckBox it copies the record to your hidden block. Then, during insert, you loop through the hidden block instead of your main data block. I don't really like this option because you have to take into account if the user Checks and then Un-Checks the CheckBox and add/remove record(s) the hidden block accordingly.
Option 2, use some type of array structure to keep track of only those records that have been selected. I actually prefer this method as it doesn't require any extra coding in the When-Checkbox-Checked trigger to copy/synchronize datablocks. Please take a look at article: How to Select Multiple Records in a block using Record Groups. This article demonstrates how to use an Forms Record Group to keep track of records selected using a Checkbox. During your INSERT processing, you can easily modify the When-Button-Pressed code in Item 24 to navigate to each selected record and insert the record into your table. While this method still navigates to each row to perform the insert, you already know which record you want through the return value of the "REC_GROUP.Get_Number()" function so you can navigate directly to the record using the GO_RECORD() built-in.
Hope this helps.
thanks for your suggestions.
this works. thank you. but I also have a ALL and None checkbox, which will select and deselect all the checkboxes at one shot respectively.
For this I can right a program unit and place the logic of when checkbox changed in the program unit and call, but consider a scenario where I click ALL checkbox (which selects say 100 checkboxes) and then unselect some few checkboxes from my block then the record group logic will not work I suppose.
Any suggestions here?