Hi!
I wondered, what VFP might want to do between SET RELATEION and SET FILTER commands?
Anyway, try to do following
use DOEVENTS instead of WAIT WINDOW
OR
put the command that refresh relations (go (recno()))
OR
set filter
before SET RELATION command.
HTH.
>hi,
>
>I dunno if this is strange or just me, anyway:
>
>in MyButton.click():
>
>private cFilter
>cFilter = filter()
>set filter to
>
>do form AnotherForm
>
>select MyTable
>set relation to blah blah blah
>set filter to &cFilter
>thisform.MyGrid.refresh()
>
>
>I use a private variable cFilter to store the current filter setting and try to restore it after another form is executed, but it's failed, the content of the grid in not filtered after the above events..
>
>So I tried to do some debugging.. I've added a wait window command in the codes as following:
>
>private cFilter
>cFilter = filter()
>set filter to
>
>do form AnotherForm
>
>select MyTable
>set relation to blah blah blah
><b>wait window transform(cFilter)</b>
>set filter to &cFilter
>thisform.MyGrid.refresh()
>
>
>The code works now! But no one would show users the filter settings when the program is running, right? What should I do now? Why does my code only work probably with a wait window command?
>
>p.s. I have tested by running the program in VFP and by running a compiled .exe, but same things happened.
>
>Thanks in advance!
>Jimi
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.