Solved

Use List box values as query criteria

Posted on 2009-04-14
2
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

738 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