Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What do you think of this picklist idea?
Message
De
13/07/1998 14:31:43
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00116853
Message ID:
00116889
Vues:
17
>>I'm interested in building a ComboBox picklist that has a '< New >' selection in it (like Quicken's Pulldown picklists).
>>I don't like the idea of using a view as the RowSource, because of the constant Requery()s, so I'm thinking of using the base table and (1) appending a blank record (with '< New >' as the name), (2) deleting it (and re-appending it if a pack is done), (3) always using buffering for the forms that use it, and (4) Recalling it in GotFocus() and Deleting it again in LostFocus().
>>
>>What kind of problems do you think I'll run into?
>>
>>TIA
>Bill,
>
>You can set the rowsourcetype to None and put this code in the requery of the combo;
>
>
>* Combo classes requery
>LOCAL lcAlias, lcOrder, lnNewItem
>lcAlias = ALIAS()
>SELECT <TheAlias for the combo>
>lcOrder = SET("ORDER")
>SET ORDER TO <the tag you want>
>GO TOP
>WITH THIS
>   .Clear()
>   lnNewItem = .NewItemId + 1
>   .AddListItem("<NEW>",lnNewItem)
>   SCAN
>      lnNewItem = .NewItemId + 1
>      .AddListItem(TabelFieldName,lnNewItem)
>   ENDSCAN
>ENDWITH
>
>
>The add a call to the Requery in the Init to the combo is initially filled. Anytime you want to refresh the list of options in the combo call its requery method.

I haven't tried this because my help file says that .AddListItem and .AddItem only work when .RowSourceType=0. I don't want to build the list, I want to use .RowSourceType=3 or 6.
Bill Morris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform