A family of Microsoft relational database management systems designed for ease of use.
That's because the computed Expr1 column is taken from the qryAttendanceData query, not from the tblStudentData table. The column from the query will be Null for each 'perfect' student because of the lack of matches in tblStudentAttendanceData. You can overcome this by changing the references in the cross tab query to 'qryAttendanceData.Expr1' to the expression 'tblStudentData.[Last_Name] & ", " & 'tblStudentData.[First_Name]'. But the result table will not include any counts for these students as counting Nulls gives you Null. This may be what you want, but if not I've tried to put forward a solution below which gives you at least some indication that these are students with perfect attendances.
As far as I can see the root of the problem is that those students with perfect attendance are not recorded as such per se, but 'perfection' is implied by the absence of rows in tblStudentAttendanceData. I have to confess that this sounds somewhat illogical to me, as I'd have expected a perfect attendance record to be represented by rows in tblStudentAttendanceData for all possible attendance dates. However, this apparently not being the case, probably the best you can do is change the original qryAttendanceData so that it returns all students regardless of matched, by means of LEFT OUTER JOINS, and using the NZ function to substitute values for the Nulls which would otherwise be returned at the attendance data and attendance code column positions where there are not matches. Try something like the following:
SELECT
tblStudentData.Student_Number,
tblStudentData.Home_Room,
[Last_Name] & ", " & [First_Name] AS FullName,
tblStudentData.First_Name,
NZ(tblAttendanceCode.AttCode,"Uncoded") AS AttCode,
NZ(tblStudentAttendanceData.Att_Date,"All dates") AS Att_Date,
NZ(tblStudentAttendanceData.Att_Comment,"Perfect attendance") AS Att_Comment
FROM (tblStudentData LEFT JOIN tblStudentAttendanceData
ON tblStudentData.Student_Number=tblStudentAttendanceData.Student_Number)
LEFT JOIN tblAttendanceCode ON tblStudentAttendanceData.Att_Code=tblAttendanceCode.AttCode
ORDER BY tblStudentData.Home_Room, [Last_Name], [First_Name];
You could then base your original crosstab query on this, but note that I've changed the default and rather meaningless Expr1 computed column name to FullName.
While this should ensure that all students are returned the values at the intersections in the crosstab query's result table will be rather inconsistent as for those students with an attendance record the value will be the number of attendances per code recorded, whereas for those with a perfect attendance record the values will, I think, be 1 for the 'Uncoded' column heading, so there are no counts of attendances as such for the 83 students. But without any data in the base tables to record their attendances there cannot be any counts of course, i.e. the problem stems from the way in which the attendances are recorded.
Ken Sheridan, Stafford, England