pulling data

krester

Registered User.
Local time
Today, 20:53
Joined
Aug 29, 2007
Messages
31
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.

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 :confused: ?
 
Last edited:
What exactly are hope to do?

y = num_n ???

Shouldn't Sum = Count?

Why not "Select * From Table Where Field = Condition"

then all records = y
 
Hi David,
* What I hope to get is – in each iteration, I want to get "member_id" from the next record.
* You are right – "sum" have to be "count".
* I want to select all records from tblMembe, so I have no condition.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom