Combo Box - Display other than 1st displayed column?

D

Dennis

Hi,

AFTER a user has choosen a row from a combo box, it appears that the combo
box automatically display the first printable column.

Is there a way to display someother column than the 1st printable column?
Sometime I would like to print the 2nd or 3rd column. Is there a way to do
this?
 
M

Mike Painter

Dennis said:
Hi,

AFTER a user has choosen a row from a combo box, it appears that the
combo box automatically display the first printable column.

Is there a way to display someother column than the 1st printable
column? Sometime I would like to print the 2nd or 3rd column. Is
there a way to do this?

There are several ways.
The easist way is to just relate the table the combo box displays to the
table(s) the form is based on and then just drop those field next to teh
combo box.
No code is needed.
 
M

Marshall Barton

Dennis said:
AFTER a user has choosen a row from a combo box, it appears that the combo
box automatically display the first printable column.

Is there a way to display someother column than the 1st printable column?
Sometime I would like to print the 2nd or 3rd column. Is there a way to do
this?


Actually, it displays the first column with a non zero value
in its position in the ColumnWidths property. If you want
to display more than that one column, add a text box with an
expression like =combo1.Column(N) where N is the 0 based
number of the desired column.
 
D

Dennis

Marshall,

I'm sorry, I did not clearly state my question. Please let me try again.


I have a combo box that selects three columns, part number, manufacturer,
and product description. Part number has a zero length (is not displayed)
while manufacturer and product descriptions are displayed in the drop down
list. However, once the user select a product, I want the product
description to be displayed in the combo box. Instead the Manufacturer is
displayed.

The manufacturer, product description is the "normal" seqence for the users.
Can I do this in single combo box or should I change the display sequence to
Product Description, Manufacturer?

Thanks,
 
J

John W. Vinson

Hi,

AFTER a user has choosen a row from a combo box, it appears that the combo
box automatically display the first printable column.

Is there a way to display someother column than the 1st printable column?
Sometime I would like to print the 2nd or 3rd column. Is there a way to do
this?

In addition to Mike's suggestion, you can put a textbox on the form with a
control source such as

=comboboxname.Column(n)

where n is the zero-based column number - e.g. (2) to display the third
column. This works even if the column in the combo is concealed by making it
of zero width.
 
M

Marshall Barton

Dennis said:
I have a combo box that selects three columns, part number, manufacturer,
and product description. Part number has a zero length (is not displayed)
while manufacturer and product descriptions are displayed in the drop down
list. However, once the user select a product, I want the product
description to be displayed in the combo box. Instead the Manufacturer is
displayed.

The manufacturer, product description is the "normal" seqence for the users.
Can I do this in single combo box or should I change the display sequence to
Product Description, Manufacturer?


Why not use a text box to display the description?

You cam get the combo box to disp;ay both values by
modifying its RowSource query to concatenate the two column
values into a single column:
SELECT part number, manufacturer & " - " & description
FROM table
but you might not like the way it looks.

If your form is displayed in continuous view, you can still
use a text box and do what Mike said.
 
J

Jeff Boyce

Dennis

Your definition of "printable column" and mine may not match. What do you
mean by that?

Be aware that you do NOT need to see the value on the form in order to get
the value printed.

Do you wish to see BOTH Manufacturer and Product Description, rather than
seeing only one?

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

Dennis

All,

Thanks for your suggestions. After talking with the users, I was able to
come up with a compromise between what they wanted and your suggestions.

Thanks one and all.
 

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