moving through records

Bakta

Registered User.
Local time
Today, 04:40
Joined
Aug 23, 2004
Messages
26
Sorry for something which should be very basic, but I'm stumped by the following problem :


I want to loop through a form and extract one field at time per record found.

So I wrote :

Code:
Dim rst as recordset
Dim Xnb, Cpt, Exitidx as long
set rst =  me.recordsetclone
Xnb = rst.recordsetcount
if Xnb <> 0 then
     rst.movefirst     
     For Cpt = 1 to Xnb
         Exitidx = me.[Idx_ctrl]
         'some code is supposed to be tested here, right now I put a msgbox to test the return Exitidx value
         rst.movenext
     Next
End If

But when I test this, Exitidx returns always the first value even though I loop through the appropriate number of times.

Can anyone please point out the glaring mistake I know I'm making?.
 
note to self : don't mix up rst.movenext and rst.bookmark

Case closed
 

Users who are viewing this thread

Back
Top Bottom