• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

How to create a query to select like things/

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
cssc1
Asked:
cssc1
1 Solution
 
Nick67Commented:
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
 
cssc1Author Commented:
Nick67
Thanks for all your help!
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now