S
ShadesOfGrey
New subscriber here, but over in comp.database.ms-access, Gord set me
up with a cool SQL query that puts my student attendance records in a
calendar format in Access 2003.
I have a simple entry form that allows students to find their name on a
pull-down list, then select Student or Instructor (it verifies if they
choose Instructor), then they click a button "Submit" to enter their
data and move to the next record for another student. Although they
look up their name as [First Name] & " " & [Last Name], it enters their
[ID Number] in the attendance table. This structure is: <Record No>,
<ID Number>, <Date>, and <Type>. It pulls <Date> from the current
date.
What I want is to have the report that I based on the below query run
when the user clicks "Submit", and I want to pass the student's name
([First Name] & " " & [Last Name]) to the Parameter [Enter Name] so
that they won't have to enter it twice. My problem is that the form I
use enters [ID Number] in the attendance table, instead of [Name].
PARAMETERS [Enter Name] Text ( 255 ), [Enter Year] IEEEDouble;
TRANSFORM First(IIf([Mem Type]=1,"S","I")) AS Type
SELECT Year([Date]) AS [Year], Month([Date]) AS [Month], [First Name] &
" " & [Last Name] AS Name
FROM Member_List_tbl INNER JOIN Attendance_tbl ON Member_List_tbl.[ID
Number] = Attendance_tbl.[ID Number]
WHERE ((([First Name] & " " & [Last Name])=[Enter Name]) AND
((DatePart("yyyy",[Date]))=[Enter Year]))
GROUP BY Year([Date]), Month([Date]), [First Name] & " " & [Last Name]
PIVOT Day([Date]) In
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
Any tip would be helpful!
up with a cool SQL query that puts my student attendance records in a
calendar format in Access 2003.
I have a simple entry form that allows students to find their name on a
pull-down list, then select Student or Instructor (it verifies if they
choose Instructor), then they click a button "Submit" to enter their
data and move to the next record for another student. Although they
look up their name as [First Name] & " " & [Last Name], it enters their
[ID Number] in the attendance table. This structure is: <Record No>,
<ID Number>, <Date>, and <Type>. It pulls <Date> from the current
date.
What I want is to have the report that I based on the below query run
when the user clicks "Submit", and I want to pass the student's name
([First Name] & " " & [Last Name]) to the Parameter [Enter Name] so
that they won't have to enter it twice. My problem is that the form I
use enters [ID Number] in the attendance table, instead of [Name].
PARAMETERS [Enter Name] Text ( 255 ), [Enter Year] IEEEDouble;
TRANSFORM First(IIf([Mem Type]=1,"S","I")) AS Type
SELECT Year([Date]) AS [Year], Month([Date]) AS [Month], [First Name] &
" " & [Last Name] AS Name
FROM Member_List_tbl INNER JOIN Attendance_tbl ON Member_List_tbl.[ID
Number] = Attendance_tbl.[ID Number]
WHERE ((([First Name] & " " & [Last Name])=[Enter Name]) AND
((DatePart("yyyy",[Date]))=[Enter Year]))
GROUP BY Year([Date]), Month([Date]), [First Name] & " " & [Last Name]
PIVOT Day([Date]) In
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
Any tip would be helpful!