Combo Box

B

Birderman

I have form with combo box using table to display the required options.

The bound column contains numerical index to the record containing the data.

When an item is selected from the combobox the bound column data is
displayed, how do I change this so that the associated data from the data
field is displayed on the form and not the data from the bound column.

Also, is it possible to display more than one field from the related record
selected with the combo box.

I assume these are simple problems to solve, but my brain has gone on
holiday and I cannot get a solution to work so any help would be
appreciated.

Regards
Birderman
 
J

Jason

1). Try setting the bound column's width to 0, I assume
that the data column is the next (column 2)

2). To display another column from your combo box, make a
new text box and set it's source to the name of the combo
box the reference the column property and then it's index
number. IE =[cboName].column(2). Note that access indexes
froim 0 so column 3 will refer to the 4th column.
 
A

Allen Browne

1. Open your form in design view.

2. Right-click the combo, and choose Properties.

3. Set the Column Count property (Format tab of Properties box) to the
number of columns you wish to combo to display when dropped down. (Note that
the RowSource property (Data tab) will have to have those fields available.)

4. Set the Column Widths property (Format tab) so the numeric field is
zero-width. For example, to have the first column 0 and the second one as 1
inch, set the property to:
0";1"

The combo will display the first non-zero-width column when not dropped
down, and all columns when it is dropped down.

You cannot show more than one column when the combo is not dropped down.
However you could use a Query to combine two fields into one, and use that
as the combo's RowSource. Example:
SELECT ClientID, Trim(FirstName & " " & Surname) As FullName FROM
tblClient;

Alternatively, you could place text boxes alongside the combo and show the
other columns there. To show the 3rd column of the combo, the Control Source
of the text box would be:
=[MyCombo].Column(2)
since the Column property is zero-based (i.e. the first column is counted as
zero.)
 
R

Ron Uyeshiro

Hi,

I believe to show multiple columns in your combo box:
1) source row: create your query to collect the bound
column as well as other related data..e.g., 3 columns. 2)
count row: enter 3
3) in the widths row: enter 0";2";2" (the 0 inches will
suppress the showing of the bound column)
4) the bound column: 1

I believe this setup will do what you want.

Later, Ron
 

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