Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = "SELECT tbl_CourseGivenExtraClass.*, " & _
" [FirstName] & ' ' & [LastName]" & _
" AS StudentName" & _
" FROM (tbl_CourseGivenExtraClass" & _
" INNER JOIN tbl_lnk_Student_ExtraClass" & _
" ON tbl_CourseGivenExtraClass.IdCourseGivenExtraClass =" & _
" tbl_lnk_Student_ExtraClass.IdCourseGivenExtraClass)" & _
" INNER JOIN tbl_Students" & _
" ON tbl_lnk_Student_ExtraClass.IdStudent =" & _
" tbl_Students.IdStudent" & _
" WHERE (((tbl_CourseGivenExtraClass.CourseDate)" & _
" >= #" & GetLogStartDate & "# And" & _
" (tbl_CourseGivenExtraClass.CourseDate)" & _
" <= #" & GetLogEndDate & "#))" & _
" ORDER BY tbl_CourseGivenExtraClass.CourseDate," & _
" tbl_CourseGivenExtraClass.CourseTime," & _
" [FirstName] & ' ' & [LastName];"
End Sub
|