Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Limiting choice in drop down list
Message
De
06/10/1998 16:21:21
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
À
06/10/1998 15:34:10
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00143999
Message ID:
00144367
Vues:
32
>>I think I understand your problem now! You need all the names in the list but you only want to select some of them!
>>
>>You could make your select something like this:
>>
>>SELECT IIF(active, '', '\') + name, key etc.
>>
>>This way all records will show, but inactive records can't be selected.
>
>Right! The problem seems to be that I was doing that in a RowSourceType of 3 (SQL) and it didn't seem to work. I still don't know if I was doing something wrong or it only works with certain Types.

I think Jim Booth had it right by using a type of none and building the control yourself with addlistitem.

For instance, if you define a sub-classed combobox you can add the following properties

crowsource
cdisplayfield
ckeyfield
cexcludefield && if filled must be logical and false to be excluded

and then in the requery method of the combo

this.clear

SELECT (this.crowsource)
GO TOP
i = 1

SCAN
IF EVALUATE(this.cexcludefield)
*-- true
this.additem(EVALUATE(this.cdisplayfield), i, 1)
this.additem(EVALUATE(this.ckeyfield), i, 2)
ELSE
this.additem("\" + EVALUATE(this.cdisplayfield), i, 1)
this.additem(EVALUATE(this.ckeyfield), i, 2)
ENDIF

i = i + 1
ENDSCAN

DODEFAULT()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform