Cannot successfully change the ColumnCount or ColumnWidths of a Combo Box after it is (1 Viewer)

llyal

Registered User.
Local time
Today, 09:00
Joined
Feb 1, 2000
Messages
72
Cannot successfully change the ColumnCount or ColumnWidths of a Combo Box after it is used in a form

Interesting thing i want to do to a combo box- I want to change the combo box parameters so that I can see the bound column- but only when I press a Command Button. All other times, I don't want to see the bound column.

My combo box has one bound column (normally hidden) and one "choices" column. It is bound to a field in a recordset, and when i use a continuous form or datasheet to view data, the configured combo box will show meaningful descriptions instead of IDs (which is the bound column)

I was thinking that it would be straightforward to change the ColumnCount or ColumnWidth, requery the combo, refresh the form, and I would be able to see whatever combo box column I wanted. No deal.

I have a workaround ready, but would like to know from the experienced programmers, if what I am trying to do is possible (with reasonable effort)?

Thank you!

--llyal
 

llkhoutx

Registered User.
Local time
Today, 03:00
Joined
Feb 26, 2001
Messages
4,018
the column count doesn't display columns unless your record source has that many columns.

I'd guess that the recordsource for your combobox is one one column.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:00
Joined
Feb 19, 2002
Messages
43,331
Rearrange the columns in the combobox's query so that the descriptive column is first and the numeric bound column is second. Be sure to change the bound column property. Then in the ColumnWidth property you can have both columns visible. If you adjust the column widths and control width properly, you should be able to scroll to see the bound column but it won't normally be visible.
 

llyal

Registered User.
Local time
Today, 09:00
Joined
Feb 1, 2000
Messages
72
Pat,

So re-arranging the fields in the combo is the key; that just trying to expose the bound column (the ID) of the combo cannot be done? That is odd behavior.

--llyal
 

BarkerD

Registered User.
Local time
Today, 09:00
Joined
Dec 1, 1999
Messages
106
I have actually had the same problem, and was hoping someone may know how to do this correctly.

I have a combo-box that is populated by different tables based on another combo-box.

Eg:
Select Case strCriteria

Case "WIP"
'choose WIP table to populate combo-box
'put 3 columns in box
'make widths 1,2,3

Case "RAW"
'Choose RAW table to populate combo-box
'Put 2 columns in box
'make widths 2,4

etc.

I was unable to successfully change the number of, and widths of the columns in the combo-box.

(I probably should make my own topic, but I figure our questions are related)

Duane Barker
 

Users who are viewing this thread

Top Bottom