C
Cameron
I keep getting this error when trying to run a filtered report, it is
baffling me to no end why this keeps coming up.
I have a drop down box with a selection of different training courses and
the names of the courses are selected and then used in the query to filter
the report.
SELECT Employees.Crew, [Name] & ", " & [FirstName] AS FullName,
EmpCoursesExpiredUnion.Category, EmpCoursesExpiredUnion.CourseTitle,
EmpCoursesExpiredUnion.CertificationDate, EmpCoursesExpiredUnion.ExpiryDate
FROM EmpCoursesExpiredUnion LEFT JOIN Employees ON
EmpCoursesExpiredUnion.EmpID = Employees.EmpID
WHERE (((EmpCoursesExpiredUnion.CourseTitle)=[Forms]![ReportMenu]![courses])
AND ((Employees.Active)=True))
ORDER BY Employees.Crew, [Name] & ", " & [FirstName],
EmpCoursesExpiredUnion.Category
WITH OWNERACCESS OPTION;
EmpCoursesExpiredUnion is a Union Query that the above query uses to gather
data.
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Awareness" As
Category
FROM EmpAwareness LEFT JOIN CoursesMaster ON EmpAwareness.CourseID =
CoursesMaster.CourseID
WHere (((EmpAwareness.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "FirstAid" As
Category
FROM EmpFirstAid LEFT JOIN CoursesMaster ON EmpFirstAid.CourseID =
CoursesMaster.CourseID
WHere (((EmpFirstAid.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "FunctionRelated"
As Category
FROM EmpFunctionRelated LEFT JOIN CoursesMaster ON
EmpFunctionRelated.CourseID = CoursesMaster.CourseID
WHere (((EmpFunctionRelated.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Mandatory" As
Category
FROM EmpMandatory LEFT JOIN CoursesMaster ON EmpMandatory.CourseID =
CoursesMaster.CourseID
WHere (((EmpMandatory.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Medical" As
Category
FROM EmpMedical LEFT JOIN CoursesMaster ON EmpMedical.CourseID =
CoursesMaster.CourseID
WHere (((EmpMedical.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "OES" As Category
FROM EmpOES LEFT JOIN CoursesMaster ON EmpOES.CourseID =
CoursesMaster.CourseID
WHere (((EmpOES.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "OppBlocks" As
Category
FROM EmpOppBlocks LEFT JOIN CoursesMaster ON EmpOppBlocks.CourseID =
CoursesMaster.CourseID
WHere (((EmpOppBlocks.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Orientation" As
Category
FROM EmpOrientation LEFT JOIN CoursesMaster ON EmpOrientation.CourseID =
CoursesMaster.CourseID
WHere (((EmpOrientation.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Personal" As
Category
FROM Emppersonal LEFT JOIN CoursesMaster ON Emppersonal.CourseID =
CoursesMaster.CourseID
WHere (((Emppersonal.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
UNION SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Trades" As
Category
FROM EmpTrades LEFT JOIN CoursesMaster ON EmpTrades.CourseID =
CoursesMaster.CourseID
WHere (((EmpTrades.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
I'm kind of baffled with this, and keep getting that error.
baffling me to no end why this keeps coming up.
I have a drop down box with a selection of different training courses and
the names of the courses are selected and then used in the query to filter
the report.
SELECT Employees.Crew, [Name] & ", " & [FirstName] AS FullName,
EmpCoursesExpiredUnion.Category, EmpCoursesExpiredUnion.CourseTitle,
EmpCoursesExpiredUnion.CertificationDate, EmpCoursesExpiredUnion.ExpiryDate
FROM EmpCoursesExpiredUnion LEFT JOIN Employees ON
EmpCoursesExpiredUnion.EmpID = Employees.EmpID
WHERE (((EmpCoursesExpiredUnion.CourseTitle)=[Forms]![ReportMenu]![courses])
AND ((Employees.Active)=True))
ORDER BY Employees.Crew, [Name] & ", " & [FirstName],
EmpCoursesExpiredUnion.Category
WITH OWNERACCESS OPTION;
EmpCoursesExpiredUnion is a Union Query that the above query uses to gather
data.
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Awareness" As
Category
FROM EmpAwareness LEFT JOIN CoursesMaster ON EmpAwareness.CourseID =
CoursesMaster.CourseID
WHere (((EmpAwareness.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "FirstAid" As
Category
FROM EmpFirstAid LEFT JOIN CoursesMaster ON EmpFirstAid.CourseID =
CoursesMaster.CourseID
WHere (((EmpFirstAid.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "FunctionRelated"
As Category
FROM EmpFunctionRelated LEFT JOIN CoursesMaster ON
EmpFunctionRelated.CourseID = CoursesMaster.CourseID
WHere (((EmpFunctionRelated.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Mandatory" As
Category
FROM EmpMandatory LEFT JOIN CoursesMaster ON EmpMandatory.CourseID =
CoursesMaster.CourseID
WHere (((EmpMandatory.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Medical" As
Category
FROM EmpMedical LEFT JOIN CoursesMaster ON EmpMedical.CourseID =
CoursesMaster.CourseID
WHere (((EmpMedical.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "OES" As Category
FROM EmpOES LEFT JOIN CoursesMaster ON EmpOES.CourseID =
CoursesMaster.CourseID
WHere (((EmpOES.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "OppBlocks" As
Category
FROM EmpOppBlocks LEFT JOIN CoursesMaster ON EmpOppBlocks.CourseID =
CoursesMaster.CourseID
WHere (((EmpOppBlocks.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Orientation" As
Category
FROM EmpOrientation LEFT JOIN CoursesMaster ON EmpOrientation.CourseID =
CoursesMaster.CourseID
WHere (((EmpOrientation.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
Union
SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Personal" As
Category
FROM Emppersonal LEFT JOIN CoursesMaster ON Emppersonal.CourseID =
CoursesMaster.CourseID
WHere (((Emppersonal.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
UNION SELECT EmpID, CourseTitle, CertificationDate, ExpiryDate, "Trades" As
Category
FROM EmpTrades LEFT JOIN CoursesMaster ON EmpTrades.CourseID =
CoursesMaster.CourseID
WHere (((EmpTrades.ExpiryDate)<=[Forms]![ReportMenu]![ExpiryDate]));
I'm kind of baffled with this, and keep getting that error.