combo box from a query

D

DanielS

I have two combo boxes on a form. I am trying to use the
first one as a query criteria to "filter" the available
choices for the second combo box. The query is set to run
at runtime. It seems to be working somewhat but my
problem is that Combo Box 2 shows the wrong column.

Here is my generic query code:
SELECT Table.Column1, Table.Column2 FROM Table
_WHERE (((Table.Column2) = Me!Combo1))
_ORDER BY Table.Column1 ASC

When I select a value in Combo1, the resulting selections
for Combo2 are coming from Column2 but I want to see
Column1. How do I change which column is displayed in
Combo2?
 
T

Ted Allen

Hi Daniel,

A combo will normally display the first column, unless
the column width of the first column is set to 0. Check
the column widths, and also check the order that you have
selected the columns in.

HTH, Ted Allen
 
J

John Vinson

How do I change which column is displayed in
Combo2?

Either change the order of fields so that the column you want to see
is first, or change the ColumnWidths property of Combo2 to set the
width of the column you don't want shown to 0.
 
D

DanielS

Many thanks to both John and Ted. A very simple
solution, but I couldn't figure it out. At some point I
had set the column width of Column1 to 0. All better now!

Thanks fellers.
 

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