Hi Anele.Ngqandu,
Small changes in your query
sql = "SELECT DISTINCT membersTable.StudentNumber, membersTable.Name,membersTable.Surname,StudentMarks.SubjectCode,StudentMarks.DPMark,StudentMarks.ExamMark,tableName.RecordNumber "
+ "FROM StudentMarks, membersTable, SubjectTable WHERE membersTable.StudentNumber = StudentMarks.StudentNumber AND StudentMarks.SubjectCode = SubjectTable.SubjectCode Order By RecordNumber ASC";
After got the output you can delete the column of RecordNumber.
Note: But in your query do not apply the distinct condition for multiple columns.
Cheers :)