Using a list box and combo boxes as criteria for a query

G

Guest

I'm trying to design a form where the user will have one list box where they
will select 1 or several items and they will also have several combo boxes to
choose other criteria as well to generate a query. Is it possible to use
list and combo boxes for criteria for the same query? The reason why I ask
is all the postings I've seen on using a list box as criteria for a query,
the query is being created right in the code of the form. What I want to be
able to do is create the query separately, specify criteria that points to
objects on a form in the design of the query and then just run that query
when the user clicks a button on the form.
 
S

Steve

You can use listboxes and comboboxes for criteria in a query and do what you
want. However, when you use a multiselect listbox, you have to write code to
use it as criteria to capture the multiselections in the criteria.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Alright so this is what I was trying. I got some code to write criteria for
what the user selects from the list box. What I did then was I assigned that
criteria to a text box on the form. In the query design, I'm using that
textbox as criteria for a field. When I run the query from the form I get no
results but if I manually copy/paste from the text box the critiera written
for the listbox into the criteria line of the field in design of the query,
it works fine.
 

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