Sandra Daigle re Combo box (simple)

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Sandra, I don't think you understand my question/problem.
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display. What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.
 
Jim said:
Sandra, I don't think you understand my question/problem.

It wouldn't be the first time I've misunderstood a question ;-)
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display.

In a combobox control, only one column is visible when the control is not
expanded (or dropped). The column that is displayed is always the first
column that has a width greater than zero as specified in the ColumnWidths
property. If you want both columns to show in the dropped down state then
give both a non-zero width.
What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

The BoundColumn Property of the combo determines which field from the
rowsource is used as the value for the control. So you need to set this
property to 2.
Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

Not exactly, the control gets its value from the *BoundColumn* of the
Combo's rowsource. The *ControlSource* of the combo determines where (if
anywhere) the value of the combo is saved. The underlying fieldname may be
the same in both cases (Custid for example). Consider the common
Customer->Orders scenario -- the combo might be bound to the Custid field
from a Select query from the Customer table while the ControlSource of the
combo would be the Custid field of the Orders table. You may already fully
understand this but in the above your terminology is a bit confused so I
wanted to clarify things a bit.

I don't know whether I've answered your question but one other side issue is
that you are referring to using the combo in a table. This is what we
commonly refer to as a "Lookup Field" and we usually discourage this. See
these links for more info:

http://www.mvps.org/access/tencommandments.htm
http://www.mvps.org/access/lookupfields.htm

Note that lookup tables are fine, it is merely the use of a combo or listbox
in the Display Control property under the Lookup tab of the Table design.
 
I agree with you Sandra, change the bound column to 2.
That's what I did originally, logical right? Problem is
it still returns the value from column 1! Not logical,
totally confusing and frusterating.
-----Original Message-----
Jim said:
Sandra, I don't think you understand my
question/problem.

It wouldn't be the first time I've misunderstood a question ;-)
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display.

In a combobox control, only one column is visible when the control is not
expanded (or dropped). The column that is displayed is always the first
column that has a width greater than zero as specified in the ColumnWidths
property. If you want both columns to show in the dropped down state then
give both a non-zero width.
What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

The BoundColumn Property of the combo determines which field from the
rowsource is used as the value for the control. So you need to set this
property to 2.
Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

Not exactly, the control gets its value from the *BoundColumn* of the
Combo's rowsource. The *ControlSource* of the combo determines where (if
anywhere) the value of the combo is saved. The underlying fieldname may be
the same in both cases (Custid for example). Consider the common
Customer->Orders scenario -- the combo might be bound to the Custid field
from a Select query from the Customer table while the ControlSource of the
combo would be the Custid field of the Orders table. You may already fully
understand this but in the above your terminology is a bit confused so I
wanted to clarify things a bit.

I don't know whether I've answered your question but one other side issue is
that you are referring to using the combo in a table. This is what we
commonly refer to as a "Lookup Field" and we usually discourage this. See
these links for more info:

http://www.mvps.org/access/tencommandments.htm
http://www.mvps.org/access/lookupfields.htm

Note that lookup tables are fine, it is merely the use of a combo or listbox
in the Display Control property under the Lookup tab of the Table design.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Sandra, I don't think you understand my question/problem.
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display. What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

.
 
PMFJI, as I don't see the original thread.

It sounds as though you want to see both columns when you drop down the
combo, and you also want both to show after you leave the combo box.

It sounds as though you understand Sandra's explanation. The second column
is the bound column, right?

Change your first column to be a calculated column that concatenates the two
values.

Field1 & " " & Field2

That's what you select in the combo, and it will display this, but the
second column will be the bound (stored) value.

--
Joan Wild
Microsoft Access MVP

Jim said:
I agree with you Sandra, change the bound column to 2.
That's what I did originally, logical right? Problem is
it still returns the value from column 1! Not logical,
totally confusing and frusterating.
-----Original Message-----
Jim said:
Sandra, I don't think you understand my
question/problem.

It wouldn't be the first time I've misunderstood a question ;-)
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display.

In a combobox control, only one column is visible when the control is not
expanded (or dropped). The column that is displayed is always the first
column that has a width greater than zero as specified in the ColumnWidths
property. If you want both columns to show in the dropped down state then
give both a non-zero width.
What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

The BoundColumn Property of the combo determines which field from the
rowsource is used as the value for the control. So you need to set this
property to 2.
Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

Not exactly, the control gets its value from the *BoundColumn* of the
Combo's rowsource. The *ControlSource* of the combo determines where (if
anywhere) the value of the combo is saved. The underlying fieldname may be
the same in both cases (Custid for example). Consider the common
Customer->Orders scenario -- the combo might be bound to the Custid field
from a Select query from the Customer table while the ControlSource of the
combo would be the Custid field of the Orders table. You may already fully
understand this but in the above your terminology is a bit confused so I
wanted to clarify things a bit.

I don't know whether I've answered your question but one other side issue is
that you are referring to using the combo in a table. This is what we
commonly refer to as a "Lookup Field" and we usually discourage this. See
these links for more info:

http://www.mvps.org/access/tencommandments.htm
http://www.mvps.org/access/lookupfields.htm

Note that lookup tables are fine, it is merely the use of a combo or listbox
in the Display Control property under the Lookup tab of the Table design.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Sandra, I don't think you understand my question/problem.
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display. What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

.
 
To add to Joan's suggestion another option is to create a separate textbox
which pulls the value from the column which is not visible when the combo is
not expanded - just put the following in the ControlSource of the new
textbox:

=MyCombo.column(1)

This will display the value in the 2nd column (zero based index) of the
selected record in MyCombo.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Joan said:
PMFJI, as I don't see the original thread.

It sounds as though you want to see both columns when you drop down
the combo, and you also want both to show after you leave the combo
box.

It sounds as though you understand Sandra's explanation. The second
column is the bound column, right?

Change your first column to be a calculated column that concatenates
the two values.

Field1 & " " & Field2

That's what you select in the combo, and it will display this, but the
second column will be the bound (stored) value.


Jim said:
I agree with you Sandra, change the bound column to 2.
That's what I did originally, logical right? Problem is
it still returns the value from column 1! Not logical,
totally confusing and frusterating.
-----Original Message-----
Jim wrote:
Sandra, I don't think you understand my question/problem.

It wouldn't be the first time I've misunderstood a question ;-)

If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display.

In a combobox control, only one column is visible when the control is not
expanded (or dropped). The column that is displayed is always the first
column that has a width greater than zero as specified in the ColumnWidths
property. If you want both columns to show in the dropped down state then
give both a non-zero width.

What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

The BoundColumn Property of the combo determines which field from the
rowsource is used as the value for the control. So you need to set this
property to 2.

Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

Not exactly, the control gets its value from the *BoundColumn* of the
Combo's rowsource. The *ControlSource* of the combo determines where (if
anywhere) the value of the combo is saved. The underlying fieldname may be
the same in both cases (Custid for example). Consider the common
Customer->Orders scenario -- the combo might be bound to the Custid field
from a Select query from the Customer table while the ControlSource of the
combo would be the Custid field of the Orders table. You may already fully
understand this but in the above your terminology is a bit confused so I
wanted to clarify things a bit.

I don't know whether I've answered your question but one other side issue is
that you are referring to using the combo in a table. This is what we
commonly refer to as a "Lookup Field" and we usually discourage this. See
these links for more info:

http://www.mvps.org/access/tencommandments.htm
http://www.mvps.org/access/lookupfields.htm

Note that lookup tables are fine, it is merely the use of a combo or listbox
in the Display Control property under the Lookup tab of the Table design.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


Jim wrote:
Sandra, I don't think you understand my question/problem.
If I do what you suggest, that only serves to disappear
the first column from my combo box. I need both columns
to display. What I want to do is get the data from the
second column into the field of the underlying table
without losing visability of both columns in the combo
box.

Access' wizard even allows you to select the second
column as the control source field when setting up the
combo box but it still places the data from the first
column in the underlying table.

.
 
Back
Top