HOW do you paste a crosstab query into code? I copied the SQL view and then pasted the following into an OnClick. VBA hated it. All other SQL pasted worked awesome. BTW I deliberatly mangled the docmd.SQL in order to prevent someones machine from calling it a suspect script.
DoCmd.RanSQi TRANSFORM Count(LOCALtrlr002.trlr_nr) AS 'CountOftrlr_nr
SELECT LOCALtrlr002.ero, LOCALtrlr002.pri, Count(LOCALtrlr002.trlr_nr) AS [Total Of trlr_nr]
FROM LOCALtrlr002
WHERE (((LOCALtrlr002.pri)<"07")
GROUP BY LOCALtrlr002.ero, LOCALtrlr002.pri
ORDER BY LOCALtrlr002.ero
PIVOT LOCALtrlr002.rcvd_cd;
Thanks in advance,
Rap
DoCmd.RanSQi TRANSFORM Count(LOCALtrlr002.trlr_nr) AS 'CountOftrlr_nr
SELECT LOCALtrlr002.ero, LOCALtrlr002.pri, Count(LOCALtrlr002.trlr_nr) AS [Total Of trlr_nr]
FROM LOCALtrlr002
WHERE (((LOCALtrlr002.pri)<"07")
GROUP BY LOCALtrlr002.ero, LOCALtrlr002.pri
ORDER BY LOCALtrlr002.ero
PIVOT LOCALtrlr002.rcvd_cd;
Thanks in advance,
Rap