T
Terry
I have a crosstab query that I need to filter by the value in a combobox on
a form. The combobox may be empty (null). Generally in a query I would use
criteria LIKE forms!frmName!cboName & "*" OR Is Null to filter the query
output, however this does not work in the crosstab query, I get a Jet cannot
find field forms!frmName!cboName message.
The field I'm trying to apply criteria to is PrjDir in the below SQL.
The record source for the crosstab is a union query. This query is fed
predominently from two other queries supplying real data and 12 smaller
queries that ensure at least one row for each month is present. I can filter
these queries using the above method and receive valid records, but the
crosstab still fails.
regards
The crosstab SQL is:
TRANSFORM Sum(qry_rpt_Scheduled_Invoicing_CurrentUnion.FeesAmountEst) AS
SumOfFeeAmountEst
SELECT GHMOffices.OfficeName, IIf(IsNull([Prj Dir]),"",[Prj Dir]) AS PrjDir,
Projects.IDClient, qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber,
Projects.[Project Title], Projects.IDOffice, Projects.IDCurrentLocation
FROM qry_rpt_Scheduled_Invoicing_CurrentUnion INNER JOIN (Projects INNER
JOIN GHMOffices ON Projects.IDCurrentLocation = GHMOffices.IDGHMOffice) ON
qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber = Projects.[Project
Number]
GROUP BY GHMOffices.OfficeName, IIf(IsNull([Prj Dir]),"",[Prj Dir]),
Projects.IDClient, qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber,
Projects.[Project Title], Projects.IDOffice, Projects.IDCurrentLocation
ORDER BY qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber
PIVOT qry_rpt_Scheduled_Invoicing_CurrentUnion.Month;
a form. The combobox may be empty (null). Generally in a query I would use
criteria LIKE forms!frmName!cboName & "*" OR Is Null to filter the query
output, however this does not work in the crosstab query, I get a Jet cannot
find field forms!frmName!cboName message.
The field I'm trying to apply criteria to is PrjDir in the below SQL.
The record source for the crosstab is a union query. This query is fed
predominently from two other queries supplying real data and 12 smaller
queries that ensure at least one row for each month is present. I can filter
these queries using the above method and receive valid records, but the
crosstab still fails.
regards
The crosstab SQL is:
TRANSFORM Sum(qry_rpt_Scheduled_Invoicing_CurrentUnion.FeesAmountEst) AS
SumOfFeeAmountEst
SELECT GHMOffices.OfficeName, IIf(IsNull([Prj Dir]),"",[Prj Dir]) AS PrjDir,
Projects.IDClient, qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber,
Projects.[Project Title], Projects.IDOffice, Projects.IDCurrentLocation
FROM qry_rpt_Scheduled_Invoicing_CurrentUnion INNER JOIN (Projects INNER
JOIN GHMOffices ON Projects.IDCurrentLocation = GHMOffices.IDGHMOffice) ON
qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber = Projects.[Project
Number]
GROUP BY GHMOffices.OfficeName, IIf(IsNull([Prj Dir]),"",[Prj Dir]),
Projects.IDClient, qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber,
Projects.[Project Title], Projects.IDOffice, Projects.IDCurrentLocation
ORDER BY qry_rpt_Scheduled_Invoicing_CurrentUnion.ProjectNumber
PIVOT qry_rpt_Scheduled_Invoicing_CurrentUnion.Month;