phonghue says:
Dim
strQuery
As
String
=
"SELECT STUDENTSPLACEMENTS.AutoNum, STUDENTSPLACEMENTS.StudCWID, STUDENTSPLACEMENTS.TermID, STUDENTSPLACEMENTS.FWCourse, STUDENTS.STUDLastname, STUDENTS.STUDFirstname, [STUDfirstname] + ' ' + [STUDLastname] AS Student, STUDENTSPLACEMENTS.OrgCode, STUDENTSPLACEMENTS.SupervisorName, STUDENTSPLACEMENTS.InstructorName, STUDENTSPLACEMENTS.OPPhone, STUDENTSPLACEMENTS.SPNotes, STUDENTSPLACEMENTS.ContactDate"
_
&
"FROM STUDENTSPLACEMENTS"
_
&
"INNER JOIN STUDENTS ON STUDENTSPLACEMENTS.StudCWID = STUDENTS.STUDCWID"
_
&
"WHERE STUDENTSPLACEMENTS.InstructorName= 'FacID' AND STUDENTSPLACEMENTS.TermID = 'TermID' AND STUDENTSPLACEMENTS.FWCourse = 'DropDownList2'"
_
&
"GROUP BY STUDENTSPLACEMENTS.AutoNum, STUDENTSPLACEMENTS.StudCWID, STUDENTSPLACEMENTS.TermID, STUDENTSPLACEMENTS.FWCourse, STUDENTS.STUDLastname, STUDENTS.STUDFirstname, STUDENTSPLACEMENTS.OrgCode, STUDENTSPLACEMENTS.SupervisorName, STUDENTSPLACEMENTS.InstructorName, STUDENTSPLACEMENTS.OPPhone, STUDENTSPLACEMENTS.SPNotes, STUDENTSPLACEMENTS.ContactDate"
_
&
"ORDER BY STUDENTSPLACEMENTS.FWCourse"
In the query you are missing space before WHERE and ORDER BY condition.
Also pass the selected value of DropDownList to the condition.
Use below query.
Dim strQuery As String = "SELECT STUDENTSPLACEMENTS.AutoNum, STUDENTSPLACEMENTS.StudCWID, STUDENTSPLACEMENTS.TermID, STUDENTSPLACEMENTS.FWCourse, STUDENTS.STUDLastname, STUDENTS.STUDFirstname, [STUDfirstname] + ' ' + [STUDLastname] AS Student, STUDENTSPLACEMENTS.OrgCode, STUDENTSPLACEMENTS.SupervisorName, STUDENTSPLACEMENTS.InstructorName, STUDENTSPLACEMENTS.OPPhone, STUDENTSPLACEMENTS.SPNotes, STUDENTSPLACEMENTS.ContactDate " _
& "FROM STUDENTSPLACEMENTS " _
& "INNER JOIN STUDENTS ON STUDENTSPLACEMENTS.StudCWID = STUDENTS.STUDCWID " _
& "WHERE STUDENTSPLACEMENTS.InstructorName= 'FacID' AND STUDENTSPLACEMENTS.TermID = 'TermID' AND STUDENTSPLACEMENTS.FWCourse = '" & DropDownList2.SelectedValue & "'" _
& "GROUP BY STUDENTSPLACEMENTS.AutoNum, STUDENTSPLACEMENTS.StudCWID, STUDENTSPLACEMENTS.TermID, STUDENTSPLACEMENTS.FWCourse, STUDENTS.STUDLastname, STUDENTS.STUDFirstname, STUDENTSPLACEMENTS.OrgCode, STUDENTSPLACEMENTS.SupervisorName, STUDENTSPLACEMENTS.InstructorName, STUDENTSPLACEMENTS.OPPhone, STUDENTSPLACEMENTS.SPNotes, STUDENTSPLACEMENTS.ContactDate " _
& "ORDER BY STUDENTSPLACEMENTS.FWCourse"