Hi,
Could anyone please help me to modify my query to accept parameters from a multiple choice list box. This is the SQL code behind my search query:
SELECT AircraftOperators.RegistrationNumber, AircraftOperators.PassengersNumber, AircraftOperators.ManufactureYear, AircraftOperators.EmailToOperator, AircraftOperators.ExteriorPhoto, AircraftOperators.InteriorPhoto, tblListOfAircraftOperators.OpratorName, tblAircrafts.AircraftType, tblAirports.AirportName, InfoSource.SourceType, tblCountry.CountryName, tblAircraftCategory.AircraftCategory
FROM tblCountry INNER JOIN (tblAircrafts INNER JOIN (tblAircraftCategory INNER JOIN (InfoSource INNER JOIN (tblAirports INNER JOIN (AircraftOperators INNER JOIN tblListOfAircraftOperators ON AircraftOperators.CompanyName = tblListOfAircraftOperators.ID) ON tblAirports.ID = AircraftOperators.Base) ON InfoSource.ID = AircraftOperators.Source) ON tblAircraftCategory.ID = AircraftOperators.AircraftCategory) ON tblAircrafts.ID = AircraftOperators.AircraftType) ON (tblCountry.ID = tblAirports.Country) AND (tblCountry.ID = AircraftOperators.Country)
WHERE (((AircraftOperators.RegistrationNumber) Like "*" & [Forms]![SearchForm2]![TailNumber2] & "*") AND ((AircraftOperators.PassengersNumber) Like "*" & [Forms]![SearchForm2]![PassengersNumber2] & "*") AND ((AircraftOperators.ManufactureYear) Like "*" & [Forms]![SearchForm2]![ManufactureYear2] & "*") AND ((tblListOfAircraftOperators.OpratorName) Like "*" & [Forms]![SearchForm2]![CompanyName2] & "*") AND ((tblAircrafts.AircraftType) Like "*" & [Forms]![SearchForm2]![AircraftType2] & "*") AND ((tblAirports.AirportName) Like "*" & [Forms]![SearchForm2]![AirportNameSearch2] & "*") AND ((InfoSource.SourceType) Like "*" & [Forms]![SearchForm2]![SourceSearch2] & "*") AND ((tblCountry.CountryName) Like "*" & [Forms]![SearchForm2]![CountrySearch2] & "*") AND ((tblAircraftCategory.AircraftCategory) Like "*" & [Forms]![SearchForm2]!
[List44] & "*"));
I have got an unbound multiple list box called List44 (Row Source: query based on table tblAircraftCategory, Multi Select - Extended) that needs to be passing parameters to my main query called AircraftSearch2. The multiple choice list box have the following fields:
1. Piston
2. Turbo Prop
3. Entry Level Jet
4. Light Jet
5. Super Light Jet
6. Midsize Jet
7. Super Midsize Jet
8. Heavy Jet
9. Ultra Long Range
10. Helicopter
11. Air Ambulance
12. Cargo
13. Vip Airliner
14. Airliner
The user will use the form for selecting search criteria (the form is called SearchForm2 and has 5 combo boxes, 3 text boxes and one multiple choice list box)
I'm very new to access and do not have any advance coding skills. Could anyone guide me through modifying (or coding a separate module) my query to include my multiple choice list box in my query?
Thanks
Could anyone please help me to modify my query to accept parameters from a multiple choice list box. This is the SQL code behind my search query:
SELECT AircraftOperators.RegistrationNumber, AircraftOperators.PassengersNumber, AircraftOperators.ManufactureYear, AircraftOperators.EmailToOperator, AircraftOperators.ExteriorPhoto, AircraftOperators.InteriorPhoto, tblListOfAircraftOperators.OpratorName, tblAircrafts.AircraftType, tblAirports.AirportName, InfoSource.SourceType, tblCountry.CountryName, tblAircraftCategory.AircraftCategory
FROM tblCountry INNER JOIN (tblAircrafts INNER JOIN (tblAircraftCategory INNER JOIN (InfoSource INNER JOIN (tblAirports INNER JOIN (AircraftOperators INNER JOIN tblListOfAircraftOperators ON AircraftOperators.CompanyName = tblListOfAircraftOperators.ID) ON tblAirports.ID = AircraftOperators.Base) ON InfoSource.ID = AircraftOperators.Source) ON tblAircraftCategory.ID = AircraftOperators.AircraftCategory) ON tblAircrafts.ID = AircraftOperators.AircraftType) ON (tblCountry.ID = tblAirports.Country) AND (tblCountry.ID = AircraftOperators.Country)
WHERE (((AircraftOperators.RegistrationNumber) Like "*" & [Forms]![SearchForm2]![TailNumber2] & "*") AND ((AircraftOperators.PassengersNumber) Like "*" & [Forms]![SearchForm2]![PassengersNumber2] & "*") AND ((AircraftOperators.ManufactureYear) Like "*" & [Forms]![SearchForm2]![ManufactureYear2] & "*") AND ((tblListOfAircraftOperators.OpratorName) Like "*" & [Forms]![SearchForm2]![CompanyName2] & "*") AND ((tblAircrafts.AircraftType) Like "*" & [Forms]![SearchForm2]![AircraftType2] & "*") AND ((tblAirports.AirportName) Like "*" & [Forms]![SearchForm2]![AirportNameSearch2] & "*") AND ((InfoSource.SourceType) Like "*" & [Forms]![SearchForm2]![SourceSearch2] & "*") AND ((tblCountry.CountryName) Like "*" & [Forms]![SearchForm2]![CountrySearch2] & "*") AND ((tblAircraftCategory.AircraftCategory) Like "*" & [Forms]![SearchForm2]!
[List44] & "*"));
I have got an unbound multiple list box called List44 (Row Source: query based on table tblAircraftCategory, Multi Select - Extended) that needs to be passing parameters to my main query called AircraftSearch2. The multiple choice list box have the following fields:
1. Piston
2. Turbo Prop
3. Entry Level Jet
4. Light Jet
5. Super Light Jet
6. Midsize Jet
7. Super Midsize Jet
8. Heavy Jet
9. Ultra Long Range
10. Helicopter
11. Air Ambulance
12. Cargo
13. Vip Airliner
14. Airliner
The user will use the form for selecting search criteria (the form is called SearchForm2 and has 5 combo boxes, 3 text boxes and one multiple choice list box)
I'm very new to access and do not have any advance coding skills. Could anyone guide me through modifying (or coding a separate module) my query to include my multiple choice list box in my query?
Thanks