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 
Using or on a multi field search form
Masha 

14 years ago
Yes, I'll start from the beginning.  I have a table with about 8 fields.  In order for my team to easily enter data, I created a corresponding form.  As we all know, searching in Access is not easy, so through your YouTube video and other sites, I created a new Search form, added my fields from the table, created the search query and added the appropriate macro to run the search.  I set up the query like I specified above to search those fields using "and", so field 1 contains "report" and field 2 contains "data" and my results return where that criteria is met with both fields.  The team wanted an "or" option, so return all records where field 1 contains "report" OR field 2 contains "data".  The problem is when I use the  (Like "*" & [Form Field] & "*" )  with or statements, it simply returns all rows all the time.  Ultimately, I just want it to return the correct results if I say Field 1 contain x or Field 2 contains x or Field 3 contains x, etc.... It seems that by using the LIKE, it says "return anything" or "return anything", so it is returning me everything.


Reply from Richard Rost:

Yes, now you're starting to get complicated. I am going to recommend for a form like this using the DYNAMIC SQL method that I show in several of my courses - where you actually construct an SQL statement to perform the search. However, you can TRY wrapping your criteria inside of an IIF function using IsNull to check to see if the user put a value in that form field. It's pretty difficult, and takes a few steps, but I will be covering this in my Search Seminar which should be out this weekend or early next week. Hang in there. :)

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/17/2026 6:40:09 AM. PLT: 0s