Solved

Use List box values as query criteria

Posted on 2009-04-14
2
480 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

828 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