Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing filtered table on a ListBox
Message
 
À
31/10/2001 01:53:23
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00574893
Message ID:
00575506
Vues:
13
This message has been marked as the solution to the initial question of the thread.
hi ,

Pls see these two IDs in Q163185, Q135754 in MSDN.

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.



MORE INFORMATION

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"


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



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



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



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



Create a text box, and set its ControlSource property to x.


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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform