>Hello,
>
>I am using Visual FoxPro 6.0. I have created a class with a listbox on it which uses a table. I want to set a filter on it which is given by another method outside the class using a parameter. Now I am using the next code:
>
>LPARAMETER mFilter && mFilter = 'value'
>
>USE table IN 0
>SELECT table
>SET FILTER TO table.field = '&mFilter'
>
>This is working.
>
>But now I don't want to define the table.field in the class. I have tried the next code, but that does not work.
>
>LPARAMETER mtable, mFilter && mFilter = "table.field = 'value'"
>
>USE mtable IN 0
>SELECT mtable
>SET FILTER TO mFilter
>
>This code is not working because FoxPro can not find variable mFilter.
>When I use a WAIT WINDOW to display the value of mFilter the value is right.
>
>Can anyone help me with this problem? Thank you in advance.
I think you need to try something like the following.
In the main program:
mtable = "MyTable"
mFilter = "MyTable.MyField = 3" && Set up your filter condition here"
DO MyFilterProc with mtable, mFilter
PROCEDURE MyFilterProc
USE (mtable) IN 0
SELECT (mtable)
SET FILTER TO &mFilter
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.