Computer Learning Zone CLZ Access Excel Word Windows

The four most common chemically active elements in the universe - hydrogen, oxygen, carbon, and nitrogen - are the four most common elements of life on Earth. We are not simply in the universe. The universe is in us.

-Neil deGrasse Tyson
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Search Seminar    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
LIKE
Ezell Martin 

10 years ago
Sir,

I have a question on the part of using combo boxes to filter a list and display a report to print.  I have a query which works great to filter out the data I need from a specific company I choose after selecting that company from a list in a combo box.  The combo box gets it's values from a table inside the database.  I also have a second combo box which also gets it's values from the same table inside the database the first combo box uses in order to get more specific data from out of that particular company and would like to display that data on the report.  For example I have company "A", "B" and "C".  Each company has a platoon  "A", "B" and "C" inside it.  I want to see a roster from company "B" from platoon "C" and display this data in a report from a single query, but I can't get the query to work right when I include the second combo box.  When I have the query designed with just the first combo box filter for the companies inside the query does exactly what I want it to do, but when I add the second combo box filter for the platoons then the query doesn't work.  I want the filter to give me data of the company and platoon I select in the combo box and if I leave the combo box blank for example I want it to give me all the companies (or platoons) in the appropriate combo box.  So is I select company "B" in the first combo box and leave the second combo box blank I want to see all data from all platoons (meaning "A", "B" and "C") whom are under company "B" in a single report.  If I select company "B" and platoon "C" then I only want to see the data from platoon "C" under company "B" in a single report.   If I select platoon "C" in the second combo box and leave the first combo box blank I want to see data from platoon "C" from all platoons (meaning "A", "B" and "C").  If I leave both combo boxes blank I want to see all data from all companies and platoons.  

The "LIKE" statement I used in the criteria of the query for the company field is:

Like [forms]![Administrative Reports]![Company]

I used the following expression in a field with the criteria stating --> Is Null <-- in the same query for the company:

Expr2: [forms]![Administrative Reports]![Company]

The "LIKE" statement I used in the criteria of the query for the company field is:

Like [forms]![Administrative Reports]![Platoon]

I used the following expression in a field with the criteria stating --> Is Null <-- in the same query for the company:

Expr2: [forms]![Administrative Reports]![Platoon]

If I could get the query to work right then everything else would fall into place and I could form the other reports I have generating other data on these companies and platoons to work right.  I could use your expertise on this one.  I figure it's something simple and I just am thinking on it too hard.  When I have one search/filter combo box the quest works great.  But when I added in the second search/filter combo box to get more exact data down to the platoon level I continually have issues and can't figure out how to get it to work.  I reviewed your search and MS Access Expert level classes I purchased form you and still can't figure it out.  Please get back with me on this ASAP.  Any assistance you can provide me will be most appreciated.  Thanks for your continued support and all that you do!

very respectfully,

EZELL MARTIN


Reply from Alex Hedley:

If you're using a LIKE you usually have a Wildcard (*) before and after the search term.

"SELECT * FROM x WHERE y LIKE *" & Term & "*"

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

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 12:06:42 PM. PLT: 0s