Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding customized option to Combobox
Message
De
22/12/1999 14:04:04
 
 
À
22/12/1999 13:47:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00307437
Message ID:
00307450
Vues:
15
>Hi,
>
>I am using a combobox as a dropdown list in order to establish some filtering through SQL statements. In other words if I choose "option 1" from the list I shall see only those records containing "option 1" in the corresponding field of another listbox used for display. RowSourceType is "3-SQL Statement" and I am selecting 2 columns: a description field and the indexed field used for filtering. Everything works great up to this point, but if I want to disable filtering I use a checkbox that says "All Records". What is really happening here is that the memory variable used to hold the value returned by the combobox is forced to be Null, thus the condition (in SQL statement of the listbox) WHERE field = variable is always true for all the records, giving as a result: NO FILTERING. This also works fine.
>
>My question is: How can I achieve the same results without having to use a checkbox and including the option "ALL RECORDS" in the combobox list ?

Hi Antonio,

Two possible ways:

1) Create a read/write cursor from your SELECT statement then INSERT the "ALL RECORDS" option and bind this to your combo box. Several details you'll need to work out but this is the starting point.

2) Do not bind your combo box to a RowSource ( RowSourceType = 0 (None) ), then manually populate the combo box with the choices using AddItem() and AddListItem(0) methods including the "ALL RECORDS" option.

In any case you should be able to determine which options was selected and take the appropriate action.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform