The difference is likely to be that OpenRecordset() on a local table returns
a dbOpenTable type, whereas on a query it returns a dbOpenDynaset type. The
dbOpenTable type returns the correct RecordCount instantly, whereas the
dbOpenDynaset type does not have the RecordCount until all records have been
loaded (which can be forced with a MoveLast). Chances are that this
difference accounts for what you experienced.
More importantly, using OpenRecordset on CurrentDb without explicitly
closing the recordset and setting both objects to Nothing is probably not a
good idea, as you do not get the chance to clean up.
It may be simpler and safer to use a DLookup() or DCount() on the query.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
"el Benno" <po***@landcorp.co.nz> wrote in message
news:cc**************************@posting.google.c om...
If CurrentDb.OpenRecordset("table").EOF Then ... works fine
If CurrentDb.OpenRecordset("Query").EOF Then ... doesn't?????????
microsft help is outstanding too - surprise surprise
any help greatly appreciated! / Ben