using combo box list item as query parameter

  • Thread starter Thread starter cindyb
  • Start date Start date
C

cindyb

Hi-
I have created a form that has a combo box list. I want
to be able to use that list as a parameter in a querry
that my report is based on.
I am able to do that with a fill-in field and it works
fine. However, with a 150+ options, I was hoping to give
the users a drop down, rather than having them type the
info. When I try it, my querry does not ask for a
parameter - but it pulls up no results. Any ideas? Am
I doing somethjing wrong - or is it not possible to use a
list box this way???
One thing, I am not able to fill in the control source
field, if I do it will not let me select an option. But
I'm thinking it is the control source that the query
looks for, I now have it pointing to the field name -
ANY help would be appreciated! Thanks
Cindy
 
The control source is not relevant. Leave it blank.
Control source is if you are writin the value selected back to a table not a
query.

If you are only selecting one value to use in your query then use a
list/combo box and in your query criteria field use

[Forms]![Yourformname]![yourlistboxname] for example

[Forms]![frmCustomer]![lstProduct]

If you are wanting multiple selections from your list box to go to a query,
then this is an entirely different matter and more complicated (using VBA).
For more information on this see Martin Greens website at
http://www.fontstuff.com/access/acctut19.htm. It explains every step of the
way.

Good luck
Dylan Moran
 
Thanks for that info - I'm headed back to the drawing board. Does it matter
if the combo box has manually typed fields or if it is being drawn from a
table?
Cindy

Dylan Moran said:
The control source is not relevant. Leave it blank.
Control source is if you are writin the value selected back to a table not a
query.

If you are only selecting one value to use in your query then use a
list/combo box and in your query criteria field use

[Forms]![Yourformname]![yourlistboxname] for example

[Forms]![frmCustomer]![lstProduct]

If you are wanting multiple selections from your list box to go to a query,
then this is an entirely different matter and more complicated (using VBA).
For more information on this see Martin Greens website at
http://www.fontstuff.com/access/acctut19.htm. It explains every step of the
way.

Good luck
Dylan Moran



cindyb said:
Hi-
I have created a form that has a combo box list. I want
to be able to use that list as a parameter in a querry
that my report is based on.
I am able to do that with a fill-in field and it works
fine. However, with a 150+ options, I was hoping to give
the users a drop down, rather than having them type the
info. When I try it, my querry does not ask for a
parameter - but it pulls up no results. Any ideas? Am
I doing somethjing wrong - or is it not possible to use a
list box this way???
One thing, I am not able to fill in the control source
field, if I do it will not let me select an option. But
I'm thinking it is the control source that the query
looks for, I now have it pointing to the field name -
ANY help would be appreciated! Thanks
Cindy
 
Nope, shouldn't matter.



Cindy B said:
Thanks for that info - I'm headed back to the drawing board. Does it matter
if the combo box has manually typed fields or if it is being drawn from a
table?
Cindy

Dylan Moran said:
The control source is not relevant. Leave it blank.
Control source is if you are writin the value selected back to a table not a
query.

If you are only selecting one value to use in your query then use a
list/combo box and in your query criteria field use

[Forms]![Yourformname]![yourlistboxname] for example

[Forms]![frmCustomer]![lstProduct]

If you are wanting multiple selections from your list box to go to a query,
then this is an entirely different matter and more complicated (using VBA).
For more information on this see Martin Greens website at
http://www.fontstuff.com/access/acctut19.htm. It explains every step of the
way.

Good luck
Dylan Moran



cindyb said:
Hi-
I have created a form that has a combo box list. I want
to be able to use that list as a parameter in a querry
that my report is based on.
I am able to do that with a fill-in field and it works
fine. However, with a 150+ options, I was hoping to give
the users a drop down, rather than having them type the
info. When I try it, my querry does not ask for a
parameter - but it pulls up no results. Any ideas? Am
I doing somethjing wrong - or is it not possible to use a
list box this way???
One thing, I am not able to fill in the control source
field, if I do it will not let me select an option. But
I'm thinking it is the control source that the query
looks for, I now have it pointing to the field name -
ANY help would be appreciated! Thanks
Cindy
 
Back
Top