Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET FILTER
Message
 
 
To
21/12/2000 12:06:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00455929
Message ID:
00455958
Views:
36
>Larry,
> Thanks for your help! However, this still does not seem to work. Can you actually move the record pointer if there are no records? If not, it would seem that I need to rethink my approach to view specific records.
>
>Thanks again for your help,
>Russell

I'm confused as to what exactly is going on.

You have a grid and an associated listbox. When you select a value in the listbox, you then apply a filter to the controlsource of the grid using SET FILTER TO. Some of the values in the listbox result in no records matches so the grid is blank.

If you use SET FILTER then issuing a SET FILTER TO removes the filter. Issuing a LOCATE will "move" the record pointer forcing the new filter condition to take effect. If there are records matching the filter condition, these will be displayed.

What may be missing is a refresh for the grid to force it to redisplay its controlsource. Try issuing a Grid.Refresh. If that doesn't work, you may have to issue a SetFocus as well.
lcfilterexpr = ["]+THISFORM.MyListBox.Value+["]
set filter to myfield = &lcfilterexpr
With MyGrid
   .SetFocus()
   .Refresh()
Endwith
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform