Use listbox selection for query criteria

S

stale_dry_one

I have a listbox that shows a list of regions, I am trying to create
a query that will use the listbox selection to only show records that
are in that region. I want to use this query as part of a second
query. Can anybody help with this?

Thanks,
steve
 
D

Douglas J. Steele

In your query, refer to the listbox using the syntax
Forms![NameOfForm]![NameOfListbox] (where you replace NameOfForm and
NameOfListbox with your actual names)

Note that this will only work if the form is already open when the query
runs (Access will not open the form for you), and the list box cannot have
multiselect enabled.
 
S

stale_dry_one

In your query, refer to the listbox using the syntax
Forms![NameOfForm]![NameOfListbox] (where you replace NameOfForm and
NameOfListbox with your actual names)

Note that this will only work if the form is already open when the query
runs (Access will not open the form for you), and the list box cannot have
multiselect enabled.

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






I have a listbox that shows a list of regions, I am trying to create
a query that will use the listbox selection to only show records that
are in that region.  I want to use this query as part of a second
query.  Can anybody help with this?
Thanks,
steve- Hide quoted text -

- Show quoted text -

Thank you for the advice, I have noticed a change to my form, I have 2
other listboxes that allow multiple selections, and I see that the
functionality for these boxes have changed. I can no longer select a
value in listbox2 and have it show in listbox3 as a criteria.

Does this seem right?

Thanks,
Steve
 
D

Douglas J. Steele

I have no idea what you're asking! What do you mean by "select a value in
listbox2 and have it show in listbox3"?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



Thank you for the advice, I have noticed a change to my form, I have 2
other listboxes that allow multiple selections, and I see that the
functionality for these boxes have changed. I can no longer select a
value in listbox2 and have it show in listbox3 as a criteria.

Does this seem right?

Thanks,
Steve
 

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