Setting a saved index

Is it possible to save the current used index, switch to an other index, go to some code and then switch back to the saved index. In the form the user can choose from different sortings. When starting my code I don’t know which sorting the user has choosen. I only can do this by saving the current used index. I tried the following: OldKey := Rec.CURRENTKEY; Rec.SETCURRENTKEY(…); … … … Rec.SETCURRENTKEY(OldKey); This will not work because SETCURRENTKEY want fieldnames as parameters. Thanks in advance.

Hi Perhaps Rec.Copy can help you:


COPY Use this function to copy a record from a C/SIDE table. All filters, marks, and keys are included in the copy. Record.COPY(FromRecord) Record Data type: record The record where the copy should be placed. FromRecord Data type: record The record you want to make a copy of.

bye André