Edit: problem solved. See below.
I am very new to Access but have learned a lot in a month. I do not understand VBA or SQL for the most part so I may need some explanations to be dumbed down.
I have a query with one column that has two values—either 1 or 2 or a yes/no check box. I am using both to see if I can get either one to work. A little background - 1 (or checked) would mean this person is a contractor and 2 (or unchecked) would mean a government employee.
That one column has a criteria linked to a list box in a form using the "Build..." tool. It looks like this in the criteria box:
[Forms]![NavigationPane]![ContractorSelection]
That query is linked to a report so when I select either Yes/No or 1/2 in the list box and click the corresponding command button that report when opened will only show the contractors or the government workers. I want a third option in the list box though. Both. How can I make it so if I select that third option in the list box it will include both contractors and government employees?
I tried having the table column with the corresponding values be formatted to text with the values "1", "2", and "1 or 2." I figured this would work because if I replace "[Forms]![NavigationPane]![ContractorSelection]" in the criteria field with "1 or 2" it works. But if I use the build tool to fetch it from another table, it doesnt. It works for just contractors or government workers, but not both.
I do not want to have to create one report for both categories and another report for either/or. I'm fine with making another query but since a report can only be connected to one query (I think) I don't see how that can work.
I'm not sure if it helps, but here is the SQL for the query:
SELECT Trips.TripID, Travelers.Traveler, Divisions.Division, Trips.DepartureDate, Trips.ReturnDate, Trips.MonthlyNumber, Trips.Destination, Trips.Cost, Trips.[TripCancelled?], Trips.Purpose, Trips.Justification, Travelers.[GovernmentContractor?], Travelers.[GovContractor?]
FROM Travelers INNER JOIN (Divisions INNER JOIN Trips ON Divisions.[DivisionID] = Trips.[DivisionID]) ON Travelers.[TravelerID] = Trips.[TravelerID]
WHERE (((Trips.MonthlyNumber)=[Forms]![NavigationPane]![MonthlySelection]) AND ((Travelers.[GovContractor?])=[Forms]![NavigationPane]![ContractorSelection]))
ORDER BY Trips.DepartureDate;
A huge thank you to anyone taking the time to help!