How to assign a value to a combo box?

P

Paul

I have a combo box with the drop list based on a table. The drop list have
two columns with the bound column assigned to the first column and is based
on the ID field of the table. The second column is the description (text
data type) of the item of that ID field. I set the column width in the way
like (0";2") so that only the description show in the drop list. I need to
assign a value ("description") to that combo box using vba and it will be
recognized as the id field of the bound column so that the value (ID) on the
combo box can be saved back to the table. I can assign the "description" to
that combo box but it fails to save the ID value of that description back to
the table. Thanks.
 
L

Larry Tompkins

Hi Paul,

Since the value in the combo box is actually a number. You will need to
assign the ID number instead of a description. If you don't know the ID
number, you can do a DLookup on the table to get the ID.

Hope This Helps
Larry
 
P

Paul

Thanks...but how can you aggign a numeric value to a combo box which only
has the text value showing on it?
 
L

Larry Tompkins

Hi Paul,

Quote:EndQuote:

The first column is the one bound to the combo box. You can change it to be
the 2nd column but you'll also need to change the underlying field type in
the table.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top