I have a table named "house" and I am trying to filter on a field named "R_town"
There are only 6 towns in "R_town" to choose from and filter on.
Beyond using action scripting I am pretty helpless. I have been able to use a combo box and filter on one town at a time, but I would like to be able to use a multi-select list box and filter on 2 or 3 towns at the same time.
Any help is greatly appreciated
Thanks in advance.
Ray Farland
'Create an XDialog dialog box to prompt for parameters.
DIM SHARED vc_towns as C
DIM SHARED varC_result as C
DELETE a_vc_towns
DIM a_vc_towns[6] as c
dim temp_list as c
temp_list = ""%list%
Edgartown
Oak Bluffs
Vineyard Haven
West Tisbury
Chilmark
Aquinnah
%list%
a_vc_towns.initialize(temp_list)
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Select Towns",""%dlg%
{region}
Select Towns:| [%M%.20,5vc_towns^#a_vc_towns];
{endregion};
{line=1,0};
{region}
"*15=ok_button_label!OK" "15=cancel_button_label!CANCEL"
{endregion};
%dlg%)
'all above this was created by action scripting
'I have found this next 5 lines in forum search and tried many times and ways to adapt them without success
if varC_result="OK" .and. vc_towns"""" then
filter=alltrim(vc_towns)
filter=*for_each(x,"R_town="+quote(x),filter)
filter=alltrim(filter)
filter=stritran(filter,crlf(),".or.")
DIM records_found as N
records_found = topparent.queryrun("filter","","","Yes","House",.t.)
'action scripting created: records_found = topparent.queryrun("R_town = Var-"vc_towns","","","Yes","House",.t.)
'and if only one town is selected in multi-select list box, the query works and filters on that town
'I have tried to substitute "filter" for "Var-"vc_towns"
delete vc_towns
end if
There are only 6 towns in "R_town" to choose from and filter on.
Beyond using action scripting I am pretty helpless. I have been able to use a combo box and filter on one town at a time, but I would like to be able to use a multi-select list box and filter on 2 or 3 towns at the same time.
Any help is greatly appreciated
Thanks in advance.
Ray Farland
'Create an XDialog dialog box to prompt for parameters.
DIM SHARED vc_towns as C
DIM SHARED varC_result as C
DELETE a_vc_towns
DIM a_vc_towns[6] as c
dim temp_list as c
temp_list = ""%list%
Edgartown
Oak Bluffs
Vineyard Haven
West Tisbury
Chilmark
Aquinnah
%list%
a_vc_towns.initialize(temp_list)
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Select Towns",""%dlg%
{region}
Select Towns:| [%M%.20,5vc_towns^#a_vc_towns];
{endregion};
{line=1,0};
{region}
"*15=ok_button_label!OK" "15=cancel_button_label!CANCEL"
{endregion};
%dlg%)
'all above this was created by action scripting
'I have found this next 5 lines in forum search and tried many times and ways to adapt them without success
if varC_result="OK" .and. vc_towns"""" then
filter=alltrim(vc_towns)
filter=*for_each(x,"R_town="+quote(x),filter)
filter=alltrim(filter)
filter=stritran(filter,crlf(),".or.")
DIM records_found as N
records_found = topparent.queryrun("filter","","","Yes","House",.t.)
'action scripting created: records_found = topparent.queryrun("R_town = Var-"vc_towns","","","Yes","House",.t.)
'and if only one town is selected in multi-select list box, the query works and filters on that town
'I have tried to substitute "filter" for "Var-"vc_towns"
delete vc_towns
end if
Comment