PDA

View Full Version : Solved: Variable Bound Columns in a Combo/List box?



mud2
05-20-2005, 09:30 PM
When you click on a row in a combo/list box, the data in the first row is (by default) the data "Returned".

This can be changed during design time, but, naturally

I want to choose the bound column during run time.

Or, perhaps to choose data in several columns...to use in subsequent operations.

Any Suggestions?

mud2
05-20-2005, 11:53 PM
"Almost" Solved

Define Col as integer in General...a Global Value

In Form Load, Col = 1

In a Command, option, or whatever button,

Col = Col + 1
If Col > (number of columns in combo box) Then col = 1
Combox.BoundColumn = Col
.
.
.

When the form loads the combo box opens with the bound column at column 1. When the command/option or whatever is clicked, mouse-downed...
the combo box when NEXT clicked will return the data in Column2...etc.

You can have a text box display the bound column number, or the data returned by the box.

But it seems very "Hacky"!

mud2

geekgirlau
05-22-2005, 10:56 PM
Normally you would use the Column property to return data from other columns (ie the following code gives you the data from column 3 of the combo box).


strCustomer = me.cboTest.Column(2)


Is there any reason this method won't work for you?