Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you find the problem?
Message
 
To
08/10/2001 17:53:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00565709
Message ID:
00565758
Views:
17
>I have a fairly simple form that displays a list of records with one filter. There is a set of two radio buttons to change the filter. When you click on one of the buttons, the interactive change method does the following:
>
> thisform.mstatus = iif(this.value = 1,"A","C")
>
>There is an mstatus_assign method that fires when we change mstatus:
> usual parameter
> this.mstatus = m.newval
> set filter to this.mstatus
> thisform.grid1.refresh()
>
>Seems simple, but everytime I do it, I get a message "Property mstatus is not found." Mstatus is defined as a public variable on the form. The variable this.mstatus has the correct value in it when I check prior to the grid refresh. The form and grid are both staight from the standard libraries, no new code in refresh or anything like that. What bonehead thing am I doing or overlooking???
>
>P.S. I will gladly email this code with a sample table set if you'd like to see it; it's all very small. But it's driving me crazy....
>
>TIA!

Hello Vicki,

Filters are notorious for expecting the values you set to be in scope whenever the record pointer moves or whenever the filtered table is selected. A better way is to use a constant built from a string. I use code like the following, and it works like a charm.

thisform.mstatus = iif(this.value = 1,"A","C")

In the mstatus_assign method that fires when you change mstatus:

usual parameter
this.mstatus = m.newval

lcFiltExpr = " fieldname = " + this.mstatus &&if it's a char
set filter to &lcFiltExpr
thisform.grid1.refresh()

Now, whenever the record pointer moves or whatever, the filter expression is a constant "set filter to fieldname = whatevervalue"

Hope this helps.
Phillip
Phillip Grant
Grant Computer Consulting
731.642.2162
phillip@grantcomputer.com
BrainBench Certified: Visual FoxPro, RDBMS Concepts
Previous
Reply
Map
View

Click here to load this message in the networking platform