Hi,
i have two table: Person and exam. The relation is 1:n.
I want to see in a listbox all the exam of that person.
so I write in vba:
The exam that I insert in the DB are 12 records. But tmpRS.RecordCount is 1. So in the list box I see only one record. Is the SELECT wrong and select only one record?
What's the problem?
Thanks
i have two table: Person and exam. The relation is 1:n.
I want to see in a listbox all the exam of that person.
so I write in vba:
Code:
Private Sub btn_find()
Dim tmpRS As DAO.Recordset
Set tmpRS = CurrentDb.OpenRecordset("SELECT exam FROM exam WHERE name = '" & Me.txt_name & "' ")
Dim i As Integer
For i = 0 To tmpRS.RecordCount
Me.listbox.AddItem (tmpRS.Fields(i))
Next i
End Sub
What's the problem?
Thanks
Last edited: