G
Gntlhnds
I have a form with a list box to select a value, and a button that is pressed
to create a report based on the value selected in the list box. The problem
is the query used to create the report and populate the values in the list
box is a crosstab query, which is not updateable of course.
Here is the SQL for my query:
TRANSFORM Avg(Val([tblCourseGrades].[Grade])) AS AvgOfGrade
SELECT TblStudents.[ClassNumber], TblStudents.Rank, TblStudents.[Last Name],
TblStudents.[First Name], Avg(tblCourseGrades.Grade) AS AvgOfGrade1
FROM TblStudents INNER JOIN (tblCourses INNER JOIN tblCourseGrades ON
tblCourses.CourseID=tblCourseGrades.CourseID) ON
TblStudents.StudentID=tblCourseGrades.StudentID
WHERE (((IsNumeric(tblCourseGrades.Grade))<>False)) Or
(((tblCourseGrades.Grade) Is Null))
GROUP BY TblStudents.[ClassNumber], TblStudents.Rank, TblStudents.[Last
Name], TblStudents.[First Name]
ORDER BY TblStudents.[ClassNumber], TblStudents.[Last Name]
PIVOT tblCourses.Course;
Here is the code for the button that opens the report:
Private Sub PreviewGradeReport_Click()
If Combo9.ItemsSelected.Count = 0 Then
Beep
MsgBox "No Item Selected", 48
Exit Sub
Else
DoCmd.OpenReport "rptGrades", 5, , "[ClassNumber]=" & Me.Combo9
End If
DoCmd.Close acForm, "frmSelectClassGrades", acSaveYes
End Sub
Since this method will not work for me (I can't change the selection in the
list box without the query being updateable), what other ways are there
available to me to accomplish this task I'm trying? Thanks for your help.
to create a report based on the value selected in the list box. The problem
is the query used to create the report and populate the values in the list
box is a crosstab query, which is not updateable of course.
Here is the SQL for my query:
TRANSFORM Avg(Val([tblCourseGrades].[Grade])) AS AvgOfGrade
SELECT TblStudents.[ClassNumber], TblStudents.Rank, TblStudents.[Last Name],
TblStudents.[First Name], Avg(tblCourseGrades.Grade) AS AvgOfGrade1
FROM TblStudents INNER JOIN (tblCourses INNER JOIN tblCourseGrades ON
tblCourses.CourseID=tblCourseGrades.CourseID) ON
TblStudents.StudentID=tblCourseGrades.StudentID
WHERE (((IsNumeric(tblCourseGrades.Grade))<>False)) Or
(((tblCourseGrades.Grade) Is Null))
GROUP BY TblStudents.[ClassNumber], TblStudents.Rank, TblStudents.[Last
Name], TblStudents.[First Name]
ORDER BY TblStudents.[ClassNumber], TblStudents.[Last Name]
PIVOT tblCourses.Course;
Here is the code for the button that opens the report:
Private Sub PreviewGradeReport_Click()
If Combo9.ItemsSelected.Count = 0 Then
Beep
MsgBox "No Item Selected", 48
Exit Sub
Else
DoCmd.OpenReport "rptGrades", 5, , "[ClassNumber]=" & Me.Combo9
End If
DoCmd.Close acForm, "frmSelectClassGrades", acSaveYes
End Sub
Since this method will not work for me (I can't change the selection in the
list box without the query being updateable), what other ways are there
available to me to accomplish this task I'm trying? Thanks for your help.