Abherrant Combo Box

G

Guest

Using Access 97 (sr-2)...

I have a form with a combo box (cbVendorID). The control source property is
blank. The row source is <SELECT * from tbl_Vendor>. Number of columns is 4,
(Vendor ID, Vendor Code, Vendor Name, Contact Name). Bound column is 3
(Vendor Name), Column widths are 0,1,1,1.

I can choose a vendor just fine. But the box shows the Vendor Code, no
matter what I put in the Bound Column property.

I tried using the combo box wizard to build another box from scratch. Sure
enough, same behavior. Must be table related... But the table couldn't be
simpler. It's an ID (autonumber) and three text items. No lookups. There are
relationships set up (it's a commonly used reference table...)

Any ideas?
 
G

Guest

You will have to modify your query to put the name in the first column. The
bound column defines which column is used when the combo is bound. It is also
the value returned when you reference your combo as
Me.MyCombo

The text box portion of a combo displays the first column in a multi column
combo.

The short of it is, put your fields in the order you need them to be in the
row source query.

SELECT [Vendor Name], [Vendor ID], [Vendor Code], [Contact Name] FROM
tbl_Vendor ORDER BY [Vendor Name]

One other suggestion. Avoid spaces in names. Naming should consist of
Letters, Numbers, and the Underscore. No spaces, special characters, or
reserved words (Name, Date,etc)
 
G

Guest

Klatuu,
Thanks for your response. My field names have no spaces, I just used
spaces for clarity in my message. I have specified the bound column before
and had it work. In fact, on the same form, I have done that (bound the third
column, for example). Is the issue Access '97? I'm used to AC2003/AC2007.

Is there any reason I can't still refer to other columns in the
cbVendorID.columns collection elsewhere on the form?

--
Jim


Klatuu said:
You will have to modify your query to put the name in the first column. The
bound column defines which column is used when the combo is bound. It is also
the value returned when you reference your combo as
Me.MyCombo

The text box portion of a combo displays the first column in a multi column
combo.

The short of it is, put your fields in the order you need them to be in the
row source query.

SELECT [Vendor Name], [Vendor ID], [Vendor Code], [Contact Name] FROM
tbl_Vendor ORDER BY [Vendor Name]

One other suggestion. Avoid spaces in names. Naming should consist of
Letters, Numbers, and the Underscore. No spaces, special characters, or
reserved words (Name, Date,etc)

JimS said:
Using Access 97 (sr-2)...

I have a form with a combo box (cbVendorID). The control source property is
blank. The row source is <SELECT * from tbl_Vendor>. Number of columns is 4,
(Vendor ID, Vendor Code, Vendor Name, Contact Name). Bound column is 3
(Vendor Name), Column widths are 0,1,1,1.

I can choose a vendor just fine. But the box shows the Vendor Code, no
matter what I put in the Bound Column property.

I tried using the combo box wizard to build another box from scratch. Sure
enough, same behavior. Must be table related... But the table couldn't be
simpler. It's an ID (autonumber) and three text items. No lookups. There are
relationships set up (it's a commonly used reference table...)

Any ideas?
 

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