Combo Question

S

Steve Haack

I have a 3 colum combobox and have the first column set to 0 to hide it, and
it is bound to column 1. Works just as I want it to.

However, when he dropdown list is visible, I have it showing the Date in the
first visible column, and the Event Name in the 2nd visible column. Again,
just as I want.

When the user makes a selection, I want the text field to display the Event
Name, rather than the Date.

Is there a way to make it display something other than the 1st visible
column? I could change the order of the columns in the data, but I'd rather
not.

Thanks,
Steve
 
M

Marshall Barton

Steve said:
I have a 3 colum combobox and have the first column set to 0 to hide it, and
it is bound to column 1. Works just as I want it to.

However, when he dropdown list is visible, I have it showing the Date in the
first visible column, and the Event Name in the 2nd visible column. Again,
just as I want.

When the user makes a selection, I want the text field to display the Event
Name, rather than the Date.

Is there a way to make it display something other than the 1st visible
column? I could change the order of the columns in the data, but I'd rather
not.


The combo box willl only display the first visible column
(and use that for AutoExpand) so you will have to play some
tricks to make it look the way you want.

Create a text box the same size as the text portion of the
combo box. To get this text box to display the third
column, set its expression to:
=thecombobox.Column(2)

Use a line of code in the text box's GotFocus event
procedure to reset the focus to the combo box so every thing
behaves pretty much the same as it did without the text box:
Me.thecombobox.SetFocus

Last, position the text box on top of the text portion of
the combo box. (You can use the Format - Bring to Front
menu item if needed.)
 
K

KARL DEWEY

I can not follow what you are doing --
'...the first column set to 0 to hide it, and it is bound to column 1.'
How is the 'first column' bound to 'column 1'?

You can use a calculated field to control what is displayed like this --
MyDisplay: IIF([Something]<>0, [Event Name], [YourDate])
 
S

Steve Haack

Now that I read that it doesn't make sense to me either. What I meant to say
is that the 1st column is hidden and the Combo Control was bound to column 1.

Here is what I am trying to do:

------------------------------------
| Dinner Party | V |
--------------------------------------------
|Nov. 9 | Dinner Party |
--------------------------------------------

However, I still want it to return the data from the hidden column (thats
why the control is bound to column 1) when I check it with me.combo.value=

I just want it to display the last column for the user to see.

I want to show Date, Event in the drop down, and when you select a row, I
want to combo (or listbox) to show the data from the 2nd column.

Does that make more sense?


Steve


KARL DEWEY said:
I can not follow what you are doing --
'...the first column set to 0 to hide it, and it is bound to column 1.'
How is the 'first column' bound to 'column 1'?

You can use a calculated field to control what is displayed like this --
MyDisplay: IIF([Something]<>0, [Event Name], [YourDate])

--
Build a little, test a little.


Steve Haack said:
I have a 3 colum combobox and have the first column set to 0 to hide it, and
it is bound to column 1. Works just as I want it to.

However, when he dropdown list is visible, I have it showing the Date in the
first visible column, and the Event Name in the 2nd visible column. Again,
just as I want.

When the user makes a selection, I want the text field to display the Event
Name, rather than the Date.

Is there a way to make it display something other than the 1st visible
column? I could change the order of the columns in the data, but I'd rather
not.

Thanks,
Steve
 
K

KARL DEWEY

Post your Row Source for the combo.

--
Build a little, test a little.


Steve Haack said:
Now that I read that it doesn't make sense to me either. What I meant to say
is that the 1st column is hidden and the Combo Control was bound to column 1.

Here is what I am trying to do:

------------------------------------
| Dinner Party | V |
--------------------------------------------
|Nov. 9 | Dinner Party |
--------------------------------------------

However, I still want it to return the data from the hidden column (thats
why the control is bound to column 1) when I check it with me.combo.value=

I just want it to display the last column for the user to see.

I want to show Date, Event in the drop down, and when you select a row, I
want to combo (or listbox) to show the data from the 2nd column.

Does that make more sense?


Steve


KARL DEWEY said:
I can not follow what you are doing --
'...the first column set to 0 to hide it, and it is bound to column 1.'
How is the 'first column' bound to 'column 1'?

You can use a calculated field to control what is displayed like this --
MyDisplay: IIF([Something]<>0, [Event Name], [YourDate])

--
Build a little, test a little.


Steve Haack said:
I have a 3 colum combobox and have the first column set to 0 to hide it, and
it is bound to column 1. Works just as I want it to.

However, when he dropdown list is visible, I have it showing the Date in the
first visible column, and the Event Name in the 2nd visible column. Again,
just as I want.

When the user makes a selection, I want the text field to display the Event
Name, rather than the Date.

Is there a way to make it display something other than the 1st visible
column? I could change the order of the columns in the data, but I'd rather
not.

Thanks,
Steve
 

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