P
Peter Hibbs
Why does this work -
TRANSFORM Count(tblOrders.OrderID) AS CountOfOrderID
SELECT Trim([FirstName] & " " & [LastName]) AS [Employee Name]
FROM tblEmployees INNER JOIN (tblCustomers INNER JOIN tblOrders ON
tblCustomers.CustomerID = tblOrders.CustomerID) ON
tblEmployees.EmployeeID = tblOrders.EmployeeID
WHERE (((tblOrders.ShipCountry)="USA"))
GROUP BY Trim([FirstName] & " " & [LastName])
ORDER BY Trim([FirstName] & " " & [LastName])
PIVOT tblCustomers.CustomerID;
and this does not.
TRANSFORM Count(tblOrders.OrderID) AS CountOfOrderID
SELECT Trim([FirstName] & " " & [LastName]) AS [Employee Name]
FROM tblEmployees INNER JOIN (tblCustomers INNER JOIN tblOrders ON
tblCustomers.CustomerID = tblOrders.CustomerID) ON
tblEmployees.EmployeeID = tblOrders.EmployeeID
WHERE (((tblOrders.ShipCountry)=[Forms]![frmCrosstab]![cboCountry]))
GROUP BY Trim([FirstName] & " " & [LastName]), tblOrders.ShipCountry
ORDER BY Trim([FirstName] & " " & [LastName])
PIVOT tblCustomers.CustomerID;
The difference is that the first query has the criteria 'built-in' and
the second gets the criteria from a combo box on a form. Of course the
form is open and the names are correct. The error message shown is :-
The Microsoft Jet database Engine does not recognize
'[Forms]![frmCrosstab]![cboCountry]' as a valid name or expression.
How would I open a crosstab query and select the required criteria in
a combo box control on a form?
Peter Hibbs.
TRANSFORM Count(tblOrders.OrderID) AS CountOfOrderID
SELECT Trim([FirstName] & " " & [LastName]) AS [Employee Name]
FROM tblEmployees INNER JOIN (tblCustomers INNER JOIN tblOrders ON
tblCustomers.CustomerID = tblOrders.CustomerID) ON
tblEmployees.EmployeeID = tblOrders.EmployeeID
WHERE (((tblOrders.ShipCountry)="USA"))
GROUP BY Trim([FirstName] & " " & [LastName])
ORDER BY Trim([FirstName] & " " & [LastName])
PIVOT tblCustomers.CustomerID;
and this does not.
TRANSFORM Count(tblOrders.OrderID) AS CountOfOrderID
SELECT Trim([FirstName] & " " & [LastName]) AS [Employee Name]
FROM tblEmployees INNER JOIN (tblCustomers INNER JOIN tblOrders ON
tblCustomers.CustomerID = tblOrders.CustomerID) ON
tblEmployees.EmployeeID = tblOrders.EmployeeID
WHERE (((tblOrders.ShipCountry)=[Forms]![frmCrosstab]![cboCountry]))
GROUP BY Trim([FirstName] & " " & [LastName]), tblOrders.ShipCountry
ORDER BY Trim([FirstName] & " " & [LastName])
PIVOT tblCustomers.CustomerID;
The difference is that the first query has the criteria 'built-in' and
the second gets the criteria from a combo box on a form. Of course the
form is open and the names are correct. The error message shown is :-
The Microsoft Jet database Engine does not recognize
'[Forms]![frmCrosstab]![cboCountry]' as a valid name or expression.
How would I open a crosstab query and select the required criteria in
a combo box control on a form?
Peter Hibbs.