Combo Box like Data Bound Combo Box? 
Author Message
 Combo Box like Data Bound Combo Box?

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.  

The code table has 2 fields such as AZ & Arizona.  What I want my user
to see is the spelling of the state name in the combo box, but the
state code AZ is stored in the main (service application record) file.
The Data Bound combo box and data control working together do this
very well.  I was hoping there was a way to code this activity.

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?

James Hannon



Sun, 04 Oct 1998 03:00:00 GMT  
 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



Mon, 05 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Data Bound Combo Box within a Data Bound Grid

2. enter data in a combo box based on value from another combo box

3. Data bound Combos or Not Data Bound Combos

4. Problems refreshing data from Data bound Combo Box

5. Limit subform combo box by selection in parent combo box

6. Want Access combo box to filter rowsource of another combo box

7. Populating a combo box from another combo box

8. Populate a combo box from another combo box selection

9. selecting records for 2nd combo box dependant on first combo box

10. Help filling second combo box from fist combo box

11. Combo box selection narrows next combo box choices

12. Bound combo box and text box

 

 
Powered by phpBB® Forum Software