A Combo Box control has a Rowsource, which is usually a Query. In this
case, you want a Query returning the two fields from your table.
The Control Source of the combo determines which field in the Form's
recordsource the selected value will be stored into; this should be a
numeric field in the form's query.
The Bound Column of the combo is which field will get stored - in this
case if the ID is in the first column and the text in the second, this
should be 1.
John, Ironically enough, on the combo wizard, it asks me where I want
to store the field, but it also let me say wich table to enter it
into, which I found ironic. It let me do it, but is return mixed
results. Some datavalues and some numerics.
The critical property in this case is the ColumnWidths. It's a string
of numbers specifying the width of the display of each field in the
rowsource.
A zero width is still part of the combo, but will not be
visible; when the combo is not dropped down you'll see the first
nonzero width field. So if your Rowsource has two fields, ID and
textfield, set the ColumnWidths property to 0;1.2 to store the ID but
display the textfield in a 1.2 inch wide space.
You've helped me before and no doubt would know exactly the problem,
if you had a better explanation. So here it is:
I have a subform, with a combo box. This subform has been linked to a
table, which works fine, in displaying the desired data.
I've added a combo box, with a list of items that I want to see, and
include in the record, when I click on one of the items.
The corresponding table has been set up as combo box, and I told the
table combo box wizard that "i will type in the values". And I did.
And, when I have the table open, this function works just fine.
That's it.
I suspect Access doesn't like storing an item in the same record field
space, where I'm going to make a selection, unless I somehow put in
code (involving the notinlist function, etc).
The form though, now displays both items and numbers ( I didnt put in
any numbers), in a single column.
Is a combo box too much ? Should I have specified list box instead ?
Thanks,
Jim