Or do you want to delete a record from one position and insert it in a different position (thereby shifting other records too)?
yes.
I am looking to move a record (if that records' store number is the default store of the user displaying the subfile) to position number 1, and readjust all other records by +1. (And removing the empty place in the subfile).
I actually do have this crudely accomplished by reading subfile(A) by RRN and finding the record with the correct store number, changing it's RRN and writing it to subfile(B), along with all other subsequent records from subfile(A) with an RRN of RRN + 1.
Initially, it looks like I can and do change the RRN of subfile(A). But, upon displaying subfile(A) the record order remained in the same. Which could only mean I didn't actually change the RRN. So, I went with creating subfile(B) from subfile(A).
Which leads me to ask the question if this is solution is the only good one? This subfile contains records that takes hundreds of lines of code written years ago to build inventory variances, balances and adjustments. I am looking to stay away from modifying any kind of logic. This would be a quick win for the user community to display the records with their store number at the top of the subfile, so that they don't have to page to it 50 times a day..
Main Topics
Browse All Topics





by: tliottaPosted on 2009-06-02 at 10:43:51ID: 24529408
BoomerSooner013:
I'd be interested in seeing code that could "change the RRN" of a subfile record. That is, I'm sure that it's possible to change the value of a variable that holds the RRN; but I wouldn't expect that to change the subfile in any way.
Unless you update the records you want to be displayed and redisplay the subfile; or you read the subfile, rearrange the records, rewrite them all and redisplay it; or you populate a second subfile in a different order and hide the first subfile while displaying the second;... I don't know of any way to get it done.
Are you looking to swap positions of two subfile records? Or do you want to delete a record from one position and insert it in a different position (thereby shifting other records too)? Or do you need something else?
Tom