I did an example of a test in access 2003 to load some questions from a table but i want to do it in access 2000 but the way it is done in access 2003 is like this:
but the problem is in access 2003 there is an "AddItem" and in access 2000 there isn't so how can i convert this code to use in access 2000? instead of access 2003. I cant figure it out
lee123
Code:
Private Sub LoadQuestion()
Dim NextQuestionID As Long
QuestionText = ""
ClearAnswerList
NextQuestionID = Nz(DMin("QuestionID", "QuestionT", "QuestionID > " & QuestionID))
If NextQuestionID = 0 Then
QuestionText = "Test Is Complete"
Exit Sub
End If
QuestionID = NextQuestionID
QuestionText = DLookup("QuestionText", "QuestionT", "QuestionID=" & QuestionID)
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM AnswerT WHERE QuestionID =" & QuestionID)
While Not rs.EOF
AnswerList.AddItem (rs!AnswerID & ";" & rs!AnswerText)
rs.MoveNext
Wend
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub
lee123
Comment