Solved

How to create a query to select like things/

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

773 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