How to assign a value to a combo box?

How to assign a value to a combo box?

Post by Paul » Tue, 22 Mar 2005 03:47:00


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.
 
 
 

How to assign a value to a combo box?

Post by Larry Tomp » Tue, 22 Mar 2005 07:18:39

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

 
 
 

How to assign a value to a combo box?

Post by Paul » Tue, 22 Mar 2005 09:14:23

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

How to assign a value to a combo box?

Post by Larry Tomp » Tue, 22 Mar 2005 10:48:41

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