mike60smart
Registered User.
- Local time
- Today, 03:35
- Joined
- Aug 6, 2017
- Messages
- 1,908
Hi Everyone
The following query works as it should:-
Why does the following not work?
txtStartMonth , txtEndMonth & txtYear are all unbound Combobox's with a Command Button to open the Report.
Any Help appreciated
The following query works as it should:-
Code:
SELECT qryInspectionsDue.FleetID, qryInspectionsDue.Employee, qryInspectionsDue.InspectionDate, qryInspectionsDue.Mileage, qryInspectionsDue.DueDate, qryInspectionsDue.DueRenewal, qryInspectionsDue.DueYear, qryInspectionsDue.Months
FROM qryInspectionsDue
WHERE (((qryInspectionsDue.DueYear)=[Enter Year Required]) AND ((qryInspectionsDue.Months) Between [Start Month] And [End Month]));
Why does the following not work?
txtStartMonth , txtEndMonth & txtYear are all unbound Combobox's with a Command Button to open the Report.
Code:
SELECT qryInspectionsDue.FleetID, qryInspectionsDue.Employee, qryInspectionsDue.InspectionDate, qryInspectionsDue.Mileage, qryInspectionsDue.DueDate, qryInspectionsDue.DueRenewal, qryInspectionsDue.DueYear, qryInspectionsDue.Months
FROM qryInspectionsDue
WHERE (((qryInspectionsDue.DueYear)=[forms]![frmFleetReports]![txtYear]) AND ((([qryInspectionsDue].[Months])>=[Forms]![frmFleetReports]![txtStartMonth])<=[Forms]![frmFleetReports]![txtEndMonth]));
Any Help appreciated