
Combo Box like Data Bound Combo Box?
Quote:
>I am trying to avoid the use of the Data Control and data bound
>controls. However, I need to use the combo box control to place
>values form code tables in my main file at data entry time.
<snip>
Quote:
>I have a number of different code tables and would like the combo
>boxes to load from tables that users can maintain and update.
>I know it is possible to do this for numeric values with the ItemData
>property, but I need to do this with string data. Any suggections?
Just use the good old invisible label trick (useful for many other
bound stuff too). Bound the label to your field with the code value
and fill the dropdown from the table with all the values (= you need
two data controls). Then use the dropdown's click and label's change
events to update the other one when one of them changes (use findfirst
to search the list of values and put the corresponding value to the
control that is out of sync). If you are using VB4, I advice to
create a class to wrap this thing together, it saves you work the
next time you need it (been there, done that).
-Juha