Not going to next record

  • Thread starter Thread starter jimati
  • Start date Start date
J

jimati

I always have better luck with:

Do While Not RS.EOF

I also don't think you need to rs.movelast. Just
rs.movefirst to get you to the first record.
 
jimati said:
I always have better luck with:

Do While Not RS.EOF


"Do While Not RS.EOF" is exactly the same, functionally, as "Do Until
RS.EOF". There's nothing to choose between them, except that, IMO,
logic couched in positive terms is easier for people to understand than
logic expressed in negative terms.
I also don't think you need to rs.movelast. Just
rs.movefirst to get you to the first record.

Actually, in this case you don't need either of them (since the newly
opened recordset will always be positioned at the first record, if there
is one). In fact, the code will be more secure with neither .MoveLast
nor .MoveFirst before the loop, because if the recordset is empty,
RS.MoveFirst and RS.MoveLast will both raise an error.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
[remainder snipped]
 
Back
Top