I'm currently creating a report program with a freeform query. Some users requested about the possibility of sorting by any of these columns. This part itself is done, and it´s working. My question is: Using the BROWSE br:CURRENT-COLUMN, how can I get the index to use into SET-SORT-ARROW()? This is my working code: DO: DEFINE VARIABLE hCol AS HANDLE. DEFINE VARIABLE qh AS HANDLE. IF cBrowserSort = "" THEN cBrowserSort = "DESCENDING" . ELSE cBrowserSort = "". ASSIGN hCol = BROWSE br:CURRENT-COLUMN qh = QUERY br:HANDLE cBy = "by temp" + STRING(hCol:NAME). qh:QUERY-PREPARE("FOR EACH TT-Component NO-LOCK BY " + hCol:NAME + " " + cBrowserSort + ":"). qh:QUERY-OPEN(). br:CLEAR-SORT-ARROWS(). //br:SET-SORT-ARROW(hCol:NAME, cBrowserSort EQ ""). END. Continue reading...