I have a recordset which I’m using a Do Loop on to extract records for each student and put into a spreadsheet. Problem is The student Id is in one table and the other values are in the “many” table joined on Student Id. My recordset is:
Set rstStudents1 = dbs.OpenRecordset("SELECT Students.FirstName, Students.FirstName, " _
'& " Students.FirstName, StudentUnits.UnitId FROM Students INNER JOIN " _
'& "StudentUnits ON Students.StudentId = StudentUnits.StudentId;", dbOpenSnapshot)
Question is how do I cycle through the recordset and extract the UnitIds for each student? Do I need 2 loops?
Thanks for your help.
Set rstStudents1 = dbs.OpenRecordset("SELECT Students.FirstName, Students.FirstName, " _
'& " Students.FirstName, StudentUnits.UnitId FROM Students INNER JOIN " _
'& "StudentUnits ON Students.StudentId = StudentUnits.StudentId;", dbOpenSnapshot)
Question is how do I cycle through the recordset and extract the UnitIds for each student? Do I need 2 loops?
Thanks for your help.