Solved

Use List box values as query criteria

Posted on 2009-04-14
2
472 Views
Last Modified: 2012-05-06
Hi,

Please have a look at the attached test2.mdb first. There I am populating two listbox based on a dropdown selection. Now I want to run a query where I can use the selected list box values as criteria. Say I want to populate a query which retrives the result set as,

Select * from MailingList where Listbox1.value = "Pen" and ListBox2.Value = "10"

Please help.
test2.mdb
0
Comment
Question by:suvmitra
2 Comments
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 100 total points
ID: 24139616
If an item is selected in the listbox, then you can refer to that listbox in your query
eg

select * from contacts where products = forms!form1!lstContacts.value

but this will work only if form open and item selected
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 400 total points
ID: 24139658
test this


test12.mdb
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question