Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement