do*********@pse.com wrote in
news:11*********************@f14g2000cwb.googlegro ups.com:
Yes, that does it allright! Big Thanks Tim!
I'll add it is too bad these stmts needed though, shouldn't have
to, but now that I know I'm off & running :~)
The reason this happens is that Jet does not load the entire
recordset immediately, but only requests data pages as they are
needed. It cannot calculate an accurate recordcount until all the
data pages of the table have been retrieved. The MoveLast forces
that to happen.
However, don't think that .Recordcount is not accurate in some
respects. If it's anything other than 0 then you know that some
records have been returned, and if it's 0, you definitely know that
no records matched your criteria. If it's not 0, it may or may not
be accurate, something you can't know until you force it to update
with the .MoveLast.
In most cases, you don't need the recordcount, all you need to check
is if the .Recordcount is not 0.
If you are opening your recordset just to get a recordcount, then
it's more efficient to use Count(*) as your SQL (instead of
retrieving all the matching records and then doing a .MoveLast),
because Jet SQL is optimized to be more efficient with that than it
is with the .MoveLast.
The only case where using .MoveLast to get the accurate record count
is justified is if you need to retrieve the accurate recordcount at
the same time as you're doing something else in your recordset. In
my e, this happens a lot less often than you'd think it would.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc