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 
Search Form
Pawel 

12 years ago
Hi guys,

I'm absolutely new to Access and I'm trying to build an database for aircraft operators.
I've got the basic tables structure and relationships but I'm stuck on building an search form to filter records by user input.
I've got following controls on my form (unbound):
1. AircraftType (combo box) from tblAircrafts
2. CompanyName (combo box) from tblListOfAircraftsOperators
3. TeailNumber (text box) from tblAircraftOperators
4. AirportNameSearch (combo box) from tblAirports
5. PassengersNumber (text box) from tblAircraftOperators
6. ManufactureYear (text box) from tblAircraftOperators
7. SourceSearch (combo box) from tblInfoSource
8. CountrySearch (combo box) from tblCountry
9. CategorySearch (combo box) from tblAircraftCategory
10. EamilToOperator (text box) from tblAircraftOperators
11. InteriorPhoto (Bound object frame) from tblAircraftOperators
12. ExteriorPhot (bound object frame) from AircraftOperators
I need to enable users to search for aircrafts based on those criteria. As I mentioned I'm new to Access and I don't have any advanced coding skills. I have a query build to perform the search and this is the code I've managed to write so far:

SELECT AircraftOperators.RegistrationNumber, AircraftOperators.PassengersNumber, AircraftOperators.ManufactureYear, AircraftOperators.EmailToOperator, AircraftOperators.ExteriorPhoto, AircraftOperators.InteriorPhoto, tblListOfAircraftOperators.OpratorName, tblAircrafts.AircraftType
FROM tblAircrafts INNER JOIN (tblAirports INNER JOIN (AircraftOperators INNER JOIN tblListOfAircraftOperators ON AircraftOperators.CompanyName = tblListOfAircraftOperators.ID) ON tblAirports.ID = AircraftOperators.Base) ON tblAircrafts.ID = AircraftOperators.AircraftType
WHERE (((tblListOfAircraftOperators.OpratorName)=[Forms]![SearchForm]![CompanyName]) AND ((tblAircrafts.AircraftType)=[Forms]![SearchForm]![AircraftType])) OR (((tblAircrafts.AircraftType)=[Forms]![SearchForm]![AircraftType]) AND ((IsNull([Forms]![SearchForm]![CompanyName]))<>False)) OR (((tblListOfAircraftOperators.OpratorName)=[Forms]![SearchForm]![CompanyName]) AND ((IsNull([Forms]![SearchForm]![AircraftType]))<>False)) OR (((IsNull([Forms]![SearchForm]![CompanyName]))<>False) AND ((IsNull([Forms]![SearchForm]![AircraftType]))<>False));

It's enabling two first combo boxes to perform the search correctly but I any attempts to write further code were unsuccessful.

Could anyone help me with this please?

Thanks

P.S. I've been stuck on this for almost a week now.






Reply from Richard Rost:

That's a lot of SQL. You're much better off using writing JUST the SQL you need, dynamically, as I show in my Access Search Seminar.

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/15/2026 11:28:20 AM. PLT: 1s