Probably overkill, but try this:
def temp-table t_list
field listfield as char format "x(30)"
index idx1 listfield ascending
index idx2 listfield descending.
def var this_one as char form "x(20)".
def var this_sort as char form "x(20)" view-as combo-box.
def query q_sort for t_list scrolling.
def browse br_sort query q_sort display listfield label "Field" with 10 down.
form this_one label "Word" with
side-labels 1 down three-d centered title "Add Word" frame fr_one.
form this_sort label "Sort" skip(1) with frame fr_sort.
on value-changed of this_sort in frame fr_sort do:
assign this_sort.
apply "go" to this_sort in frame fr_sort.
end.
repeat:
this_one = "".
update this_one with frame fr_one.
if this_one = "" then leave.
find t_list where t_list.listfield = this_one no-lock no-error.
if not available t_list then do:
create t_list.
t_list.listfield = this_one.
end.
end.
hide frame fr_one.
this_sort:list-items in frame fr_sort = "<Choose Sort>,Ascending,Descending".
this_sort = "<Choose Sort>".
repeat:
update this_sort with frame fr_sort.
if this_sort <> "<Choose Sort>" then leave.
end.
if this_sort = "Ascending" then open query q_sort for each t_list use-index idx1.
if this_sort = "Descending" then open query q_sort for each t_list use-index idx2.
enable br_sort with frame fr_sort.
wait-for window-close of current-window.