View Single Post
  #11  
Old February 21st, 2006, 09:37 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Combo Box Columns

try

[forms]![formname].[cboBoxname].[Column](1)

hth


"David Berg" wrote in message
...
This brings me to the next question. How do I reference the different

columns
in a query? I have a report, whose query wants to contain the clause:

HAVING
tabname.colname = [forms]![formname].[cboBoxname].[Column(1)]. Referencing
the column (at least using this syntax) is not recognized. Is there a way

to
reference the individual columns in a combo box in a query? If not, I

could,
as a workaround, concatenate the columns to form the key of the combo box

and
do likewise to the columns from the query in the HAVING clause. Thanks.

"tina" wrote:

okay, good job. i didn't see this post until i'd already responded to

the
previous one.


"David Berg" wrote in message
...
OK. I got it. I forgot the '='.
Thanks to both you and Mr. Steele.
- David

"tina" wrote:

you can't, within the combo box control itself. only the first

non-zero
width column will be displayed in the control after a selection is

made
from
the droplist. but you *can* display the values from the other

columns.
just
add an unbound textbox to the form, for each column value you want

to
display. set each textbox's ControlSource property to reference a

specific
column, as

=cboName.Column(n)

replace cboName with the name of the combo box control, of course.

replace
the "n" value, within the parentheses, with the index value of the

column
you want to display. the combo box column index is zero-based, so

the
first
column (counting from left to right) is 0, the second column is 1,

the
third
column is 2, etc.

hth


"David Berg" wrote in message
...
I would like to expand on Mr/s. Frog's question. I also have cbo's

with
multiple columns. The column counts and widths are as suggested by

Mr.
Steele. When I drop down the list box to display the list of

values in
the
domain, all the columns in the cbo are displayed. However, after a

value
is
selected, only the first column is displayed. How do I display all

columns
after a value is chosen by the user? Thank you.

"Douglas J Steele" wrote:

Column Count: 2
Column Widths: 0";1"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"MJFrog" wrote in message
...
I have a simple combo box that is taking its row source from a

newly
created
table that has only two colums - the key (just a list of

continuous
numbers)
and a list of surnames.

No matter what settings I try I can only get the combo box to

display
the
numbers from the key, how do I get it to just show the

surnames
from
column 2
of the table?

Can anyone help?