Combo Box

J

jeff

I have a combo box with 3 fields in it. I need to create
a querry that looks at the value inthe 3rd field. How
would I do this? I know how to create the field in the
querry to look at the combo box, but I do not know how to
make it look at the 3rd field.

Example,
I ahve a combo box with room description, room number,
and fieldname.
The room description and room number are easy
recognizable ways for the user to select the room. I
need to run the querry off the fieldname to compare to
the fields in the main table.

The reason for this is that I have about 35 rooms that
the user can select. I need to generate a report and form
that will pull in all events that have been in the room
specified by the combo box.
 
J

John Vinson

I have a combo box with 3 fields in it. I need to create
a querry that looks at the value inthe 3rd field. How
would I do this? I know how to create the field in the
querry to look at the combo box, but I do not know how to
make it look at the 3rd field.

A Combo Box has a Column property; it's a bit tricky since it's zero
based - the first column is Column(0)

Use a criterion of

=[Forms]![yourform]![yourcombo].Column(2)

in your query and you should be in clover.
 
G

Guest

When I put that in the field, I get a error saying the
field is not valid. It stops at column
What did i do wrong?
-----Original Message-----
I have a combo box with 3 fields in it. I need to create
a querry that looks at the value inthe 3rd field. How
would I do this? I know how to create the field in the
querry to look at the combo box, but I do not know how to
make it look at the 3rd field.

A Combo Box has a Column property; it's a bit tricky since it's zero
based - the first column is Column(0)

Use a criterion of

=[Forms]![yourform]![yourcombo].Column(2)

in your query and you should be in clover.


.
 
G

Guest

I have the following entered into the Field box:

Expr1: ([Forms]![sbfrm_spaces]![cboroom].Column(2))

when I try to exit, it gives a error message about a
undefined function.
-----Original Message-----
When I put that in the field, I get a error saying the
field is not valid. It stops at column
What did i do wrong?
-----Original Message-----
I have a combo box with 3 fields in it. I need to create
a querry that looks at the value inthe 3rd field. How
would I do this? I know how to create the field in the
querry to look at the combo box, but I do not know how to
make it look at the 3rd field.

A Combo Box has a Column property; it's a bit tricky since it's zero
based - the first column is Column(0)

Use a criterion of

=[Forms]![yourform]![yourcombo].Column(2)

in your query and you should be in clover.


.
.
 
J

John Vinson

Example,
I ahve a combo box with room description, room number,
and fieldname.
The room description and room number are easy
recognizable ways for the user to select the room. I
need to run the querry off the fieldname to compare to
the fields in the main table.

The reason for this is that I have about 35 rooms that
the user can select. I need to generate a report and form
that will pull in all events that have been in the room
specified by the combo box.

Whoa. On rereading this, it appears that you are violating normal form
by storing data - a room name - *in a field name in a table*, rather
than as data in a Room field in a table! Is that correct?

What's the Row Source of the combo box? What's the SQL of the query
into which you are attempting to use the combo box information? Do you
want the combo box to specify which *field* of a table you will
display? If so... you can't, not without creating the SQL of the query
in VBA code.
 

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