I have a combo box that has 4 columns, and is bound by Column 1 which is the unique number. I have this cou,n hidden using 0;2;2 etc,etc. Once the user selects the row from the combo box that they wish to enter the box only shows column 2 and not columns three and four. Can I make the combo box show all the colums I want it to?
Sure...You can progmaticly change the ComboBox ColumnWidths, ColumnCount, and ListWidth properties to make your ComboBox control to display whatever you like. You just have to remember to do everything in twips instead of inches or cm (1" = 1440 twips). You can however use inches or cm's for the ColumnWidths property but it must be done in this fashion:
If you want a column to display enter any size greater than zero. If you dont want a specific column to display then make sure the size is set to zero (0). In the first ColumnWidths sample, the 2nd column will not be displayed within the ComboBox. In the second ColumnWidths sample, the 3rd column will not be displayed within the ComboBox.
If you want to progmaticly set the ListWidth then it must be set by way of Twips. For example: If we want to set our ComboBox ListWidth to 3", we would have a code line as follows:
Me.myComboBoxControlName.ListWidth = 3 * 1440
The ColumnCount property simply required a Integer number value.
Between these three properties, and a Query or SQL combination, you can make your ComboBox display whatever you like, whichever way you like to.
1) You can modify the ComboBox properties in both Design time and progmaticly in Run time. Both will produce the same results. When changing the properties in design time, enter all parameters in either inches or cm's.There is no need to worry about twips in Design mode since the coversion.is automatically done once placed into Run mode.
2) If you want to actually change a ComboBox properties progmaticly, when and where to initiate the code is entirely up to you. Perhaps if a button is selected, or during an event from another control. Only you can decide this at this point since very little information has been provided about your specific application.