Solved

Use List box values as query criteria

Posted on 2009-04-14
2
452 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
Comment Utility
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 119

Accepted Solution

by:
Rey Obrero earned 400 total points
Comment Utility
test this


test12.mdb
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now