Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Query from mulitple comboboxs
Brad Rudolph 
    
3 years ago
I have a form with 3 combo boxes on it to select items to filter a query on.  I am showing the data from the filtered query in a form.  I would like the filter to use the selection from any single combo-box or or combination of 2 combo-boxes.  Here is the code in the query I am using.  It works fine when doing any single combo-box but when adding the last or statement for the 2 combo-boxes it will not return data.  If i have only the 2 combo-boxes and none of the single filters it works.

SELECT TBL_Purchase_Order1.PO_Num, TBL_Purchase_Req1.PR_Num, TBL_Purchase_Req1.Requestor, TBL_Purchase_Req1.Vendor, TBL_Purchase_Req1.PR_Description, TBL_Purchase_Req1.PR_Date, TBL_Purchase_Req1.Approver, TBL_Purchase_Req1.Send_Approval, Sum(TBL_PR_Lines1.Cost) AS [PO Total]
FROM (TBL_Purchase_Req1 LEFT JOIN TBL_Purchase_Order1 ON TBL_Purchase_Req1.PR_Num = TBL_Purchase_Order1.Purchase_Req_Num) INNER JOIN TBL_PR_Lines1 ON TBL_Purchase_Req1.PR_Num = TBL_PR_Lines1.Purchase_Req_Num
GROUP BY TBL_Purchase_Order1.PO_Num, TBL_Purchase_Req1.PR_Num, TBL_Purchase_Req1.Requestor, TBL_Purchase_Req1.Vendor, TBL_Purchase_Req1.PR_Description, TBL_Purchase_Req1.PR_Date, TBL_Purchase_Req1.Approver, TBL_Purchase_Req1.Send_Approval
HAVING (((TBL_Purchase_Req1.PR_Num)=[Forms]![FRM_Reports_Queries]![Combo_PRnum_Filter])) OR (((TBL_Purchase_Req1.Requestor)=[Forms]![FRM_Reports_Queries]![Combo_Requester_Filter])) OR (((TBL_Purchase_Req1.Vendor)=[Forms]![FRM_Reports_Queries]![Combo_Vendor_Filter])) OR (((TBL_Purchase_Req1.Requestor)=[Forms]![FRM_Reports_Queries]![Combo_Requester_Filter]) AND ((TBL_Purchase_Req1.Vendor)=[Forms]![FRM_Reports_Queries]![Combo_Vendor_Filter]));
Scott Axton  @Reply  
        
3 years ago

Brad take a look at the Search Form 2.0 videos.
Specifically how Richard builds the WhereString. I think that will help you figure out things.

The SQL you posted doesn't make a ton of sense to me since I don't know your table structures, field names, events, and such.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 4:33:58 AM. PLT: 0s