Solved

How to create a query to select like things/

Posted on 2011-09-21
2
232 Views
Last Modified: 2012-05-12
Attached is a query that selects the same color cars from two tables. What I am trying to do is change slightly. I want to use checkboxes (yes/No) for the three color cars (Red, Blue and Green) in each table. So, if a user selects (checks) red from table 1 and Red from table two, the query brings up theses similar choices.
SelectTest-9-21-2011.mdb
0
Comment
Question by:cssc1
2 Comments
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 36577576
That's a very rough sample.
It almost seems like homework--which Experts are not permitted to complete
What you are looking for is a parameterized union query

select * from LotCars1 where iif(forms!someform!chkRed1=true,carcolor="red",1=2)

Union ALL

select * from LotCars1 where iif(forms!someform!chkBlue1=true,carcolor="Blue",1=2)

Union ALL

select * from LotCars1 where iif(forms!someform!chkGreen1=true,carcolor="Green",1=2)

Union ALL

select * from LotCars2 where iif(forms!someform!chkRed2=true,carcolor="red",1=2)

Union ALL

select * from LotCars2 where iif(forms!someform!chkBlue2=true,carcolor="Blue",1=2)

Union ALL

select * from LotCars2 where iif(forms!someform!chkGreen2=true,carcolor="Green",1=2)


See someform and Query1 on your returned sample
SelectTest-9-21-2011.mdb
0
 

Author Closing Comment

by:cssc1
ID: 36581637
Nick67
Thanks for all your help!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
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…

758 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

22 Experts available now in Live!

Get 1:1 Help Now