Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limiting choice in drop down list
Message
From
06/10/1998 16:21:21
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
To
06/10/1998 15:34:10
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00143999
Message ID:
00144367
Views:
30
>>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()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform