Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox values not in rowsource data
Message
From
11/10/2004 10:18:53
 
 
To
11/10/2004 09:04:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00950379
Message ID:
00950417
Views:
36
I have a need to have a combobox where the row source values contains the most used values, but I need the user to be able to key a value that is not in the row source values. I don't want to add the new values to the row source, just use it for this instance.

We have 2 such combo box classes in Chapter 5 of 1001 Things You Wanted to Know About Visual FoxPro

So what if I want to bind my combo to a value that isn't in the list? (Example: CH05.VCX::cboSpecial and CH05.VCX::cboNotInList)

The first question that leaps to mind here is "Then why are you using a combo box?" Combo and list boxes are used to limit data entry to a set of predefined selections. Permitting the user to enter an item that isn't in the list defeats the purpose of using a combo box in the first place. Having said that, we realize there may be occasions where this sort of functionality is required. For example, let's suppose a particular field in a table is usually populated from a set of standard selections. However, occasionally none of the standard selections are suitable and the end user needs to enter something that is not in the list. Clearly, if the non-standard items were regularly added to the underlying lookup table, the table would grow quickly with seldom used entries. In this instance, the field binding to the combo box must contain the description of the item in the lookup table and not its key value. Obviously, if we allow the field to be bound to items that are not in the list, we must store the information in this non-normalized manner. The only place to "look up" such ad hoc items is in the bound field itself!
Previous
Reply
Map
View

Click here to load this message in the networking platform