>Either way that i run the procedure it still says that the variable is not found. But if I run it in the command window it will work fine. Any ideas?
>
>Thanks
procedure filter_set
lparameters t_f,tblname,condition
select (tblname)
tblFilter = iif(t_f,'set filter to &tblname..stu_ads_id = condition','set filter to')
&tblFilter
return
Because this is done in a procedure the 'condition' parameter loses scope when you exit the procedure. The 'condition' parameter is a local variable and is released when you exit the proc. Therefore, you get "Variable 'condition' not found" error. You might try:
tblFilter = iif(t_f,'&tblname..stu_ads_id = ' + condition,'')
set filter to &tblFilter
In other words the filter string has to have the value of the parameter and not the name of the variable in it.
Mark McCasland
Midlothian, TX USA