Recordsets

  • Thread starter Thread starter miaplacidus
  • Start date Start date
M

miaplacidus

How come the query "EmployeePhones" produces 150 records
but rs = db.openrecordset("EmployeePhones") produces one
record?
 
Hi,
If you're getting that number from the RecordCount property, make sure you do a
rs.MoveLast before you check it. That will fully populate your recordset.

HTH
Dan Artuso, MVP
 
Oh, Geez. Isn't a recordset a set? If MoveLast works then
why didn't MoveNext work when I was trying to loop through
the set?

What do I do, MoveLast to populate the set then MoveFirst
so I can loop through?
 
Hi,
Well, you only need to MoveLast if you want to check the RecordCount property.
Otherwise just do a MoveFirst and then start your loop.

HTH
Dan Artuso, MVP
 
Nope, If I just use MoveFirst and then loop through I
only have one record, but if I MoveLast, check the record
count and MoveFirst, then the loop works properly.
 
Hi,
What is your code?
Is it:
While Not rs.EOF Then ....

Because that should work.

If you're using something like:
For i = 1 to rs.RecordCount -1 ...

You would have that problem.
 
Back
Top