One more on linked combo boxes

O

owilson

Hi,

First of all, a big thanks to Kurt and Rob for helping me
get this thing working. I have one more question
regarding linked combo boxes. I'd like to display more
than one row in the first box (cboDivisions). If I use:

[Div] & ", " & [DivDesc] AS FullName

both the Division and the Description will show up,
but the linked box cannot read it.

As it is now, only the Division number is displayed after
a selection is made. Any help here would be greatly
appreciated.

TIA

Owen
 
N

Nikos Yannacopoulos

Owen,

You are not doing this in the best way. Access combos allow you to show
multiple columns in a combo while a selected one is the bound one, i.e. the
one whose value is returned. Go to the combo's Rowsource property (tab Data)
and click on the little button with the three dots on the right, to invoke
the query builder; when taken to the query design view, add the Divisions
table (or whatever it's called, and drag down to the grid both columns (or
more) that you want displayed. You can add criteria if required. Close and
get back to the form design; still in the combo's properties, leave the
Bound Column property to the default 1 if you want the combo to return the
value in the first column, or change accordingly; go to tab Format, and set
the Column Count property to the number of columns in the query: this is the
number of columns that will be displayed.
If you want, you can actually display DivDesc only, while the combo still
returns Div; to do this, go to the Column widths property and give it
something like 0;5 (or whatever). This sets the width of the first column to
zero, so it is invisible, but it is still there and the combo can return its
value!

HTH,
Nikos
 

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