Solved

How to create a query to select like things/

Posted on 2011-09-21
2
242 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
[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 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

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
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…

690 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