I have the follwing query
This will produce the following results on a sub form
StudentID Student Name
0003 Joe
0045 Henry
0029 Harold
0134 Martin
What i am trying to do is have row numbers next to each record, so something like this
Row Number StudentID Student Name
1 0003 Joe
2 0045 Henry
3 0029 Harold
4 0134 Martin
Any help would be appreciated.
Code:
SELECT tbl_Students.StudentID AS StudID, Format([StudID],"0000") AS StudentID, ignoreSpace(tbl_Students.StudentName & " " & [StudentMiddlename] & " " & [StudentSurname]) AS StudentName
FROM tbl_Classes RIGHT JOIN (tbl_Students RIGHT JOIN tbl_StudentClassJoin ON tbl_Students.StudentID = tbl_StudentClassJoin.StudentID) ON tbl_Classes.ClassID = tbl_StudentClassJoin.ClassID
WHERE (((tbl_StudentClassJoin.ClassID)=[Forms]![frm_Search].[cmbClassID]))
ORDER BY ignoreSpace(tbl_Students.StudentName & " " & [StudentMiddlename] & " " & [StudentSurname]);
StudentID Student Name
0003 Joe
0045 Henry
0029 Harold
0134 Martin
What i am trying to do is have row numbers next to each record, so something like this
Row Number StudentID Student Name
1 0003 Joe
2 0045 Henry
3 0029 Harold
4 0134 Martin
Any help would be appreciated.