Thread: Crosstab Report
View Single Post
  #1  
Old May 10th, 2010, 07:28 PM posted to microsoft.public.access.reports
gngsquared[_2_]
external usenet poster
 
Posts: 1
Default Crosstab Report

I searched, and tried to utilize the answers I found, but I don’t have the
skills to make them work.

I have the crosstab query shown below which works fine when the results are
in datasheet view:

TRANSFORM Max(DetailTbl.DetailID) AS MaxOfDetailID
SELECT EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
FROM TrainDocTbl INNER JOIN (EmpTbl INNER JOIN DetailTbl ON EmpTbl.EmpID =
DetailTbl.EmpID) ON TrainDocTbl.TrainDocID = DetailTbl.TrainDocID
WHERE (((TrainDocTbl.SelectRec)=On) AND ((EmpTbl.TermDate) Is Null))
GROUP BY DetailTbl.EmpID, EmpTbl.EmpNo, EmpTbl.Lname, EmpTbl.Fname
ORDER BY EmpTbl.Lname, EmpTbl.Fname, TrainDocTbl.TrainDocName
PIVOT TrainDocTbl.TrainDocName;

[SelectRec] is a Y/N field. There is a form with a listbox that allows the
user to check which qualifications meet the customer’s needs and then the
query runs to provide the results. There are currently 15 qualifications to
choose from, but I’m sure this number will expand as time goes on.

The required qualifications may change and the report needs to change the
column headings to reflect this and that is the problem. If I design the
report for qualifications A, B, and C when the user asks for E, H, and J the
report gags.

Additionally, I have formatted the text box on the report to show either YES
or – by using the following expression: =IIf([fieldname] Is Not Null,"YES","--
")

Although this works, I’m sure there is a better way of doing it.
HELP!