I have a table: tblMembers (member_id, member_fn, member_ln etc.)
I want to write a loop that goes to tblMembers and brings member_id. At the begging the member_id in the first recorde then in the second recorde … and so until the last record.
I want to write a loop that goes to tblMembers and brings member_id. At the begging the member_id in the first recorde then in the second recorde … and so until the last record.
This is what I wrote – but it's not working
Dim rstMember As DAO.Recordset
Set rstMember = CurrentDb.OpenRecordset("select * from tblMember")
For y = 1 To num_m 'num_m is records count in the table
If y = 1 Then
rstMember.FindFirst
Else
rstMember.FindNext
End If
mem_id = rstMember![member_id]
next y
What's wrong with my code
?
Last edited: