Microsoft KB Archive/135754

= BUG: ListBox Does Not Refresh Properly with SET FILTER Command =

Article ID: 135754

Article Last Modified on 5/7/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q135754



SYMPTOMS
A listbox displaying fields from a table is not refreshed correctly when the following commands are issued: SET FILTER TO Then one of the following two commands: ThisForm.Refresh ThisForm.List<#>.Refresh



WORKAROUND
Immediately after issuing the SET FILTER command, issue a SETFOCUS command to the list box and back again to the object on the form where control should be. As in the "Steps to Reproduce Behavior" below, in the Click event of the command buttons, the following lines of code would be used: ThisForm.List1.SetFocus      && sets the focus to the list box ThisForm.Command<#>.SetFocus && sets the focus back to the button



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
 Create a new form. Add the Customer table to the data environment. Create a list box on the form.  Set the RowSource property to "customer.country" Set the RowSourceType to "6 - Fields"</ol> </li>  Create a Command1 button, and enter the following code in its Click event procedure: SET FILTER TO maxordamt < 25000.0000 && sets the filter x=FILTER               && populating the variable with the filter thisform.refresh         && refreshing the form </li>  Create a Command2 button, and enter the following code in its Click event procedure: SET FILTER TO maxordamt = 5000.0000 && sets the filter x=FILTER              && populating the variable with the filter thisform.refresh        && refreshing the form </li>  Create a Command3 button, and enter the following code in its Click event procedure: SET FILTER TO country = "Germany" && sets the filter x=FILTER              && populating the variable with the filter thisform.refresh        && refreshing the form </li>  Create a Command4 button, and enter the following code in its Click event procedure: SET FILTER TO           && clears the filter x=FILTER              && populating the variable with the filter thisform.refresh        && refreshing the form </li> Create a text box, and set its ControlSource property to x.</li> Run the form, and click the Command1 button. Notice that the list box doesn't refresh properly. Click the other buttons, and watch the behavior of the list box. Click the list box, and watch the contents change according to which filter is set. Watch the text box to see which filter is set.</li></ol>

Additional query words: kbvfp300 kbvfp500 kbvfp600

Keywords: kbbug KB135754

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.