But it lack two features - as far as I know:
- The ability to set a default value
- Enable the user to key in the value
I have been looking to find a way make it happen, but with no luck. I have
looked around to find another component that could support my requirements
but haven't found it yet.
Does anybody know how it can be done with TDBLookupCOmbobox or know of a
component that does I would be very gratefull.
brgds,
Soren...
bosVision
Bakketoppen 23
DK-3450 Allerod
email: sbl...@post7.tele.dk
You are looking for that in the wrong place. To set defaults you override
the OnNewRecord event of the dataset and there assign the default values to
the record fields. This will be automatically reflected in the associated
data-aware controls. This is a general rule: in code you never modify the
data-aware controls, you modify the fields of the associated dataset.
> - Enable the user to key in the value
The TDBLookupCombobox allows the user to select from the available values,
which is much preferrable (=less error prone) than allowing the value to be
typed in. If the user needs a means to add new values to the lookup dataset,
consider placing an "Add" button for that next to the lookup combobox. The
button would pop up an input dialog for the new value. If new values are
added infrequently that is a pretty good solution. If new values are added
frequently it may be a bit cumbersome, though. But it makes the users intent
clear. If you allow typing in a value both for selecting an existing and
adding new values to the lookup dataset you cannot really distinguish a
genuine new value from a simple typo made when the user intended to select
an existing value.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be