Bill said:
I know you can open a table, move last and get the recordcount.
But, is there any way to find out how many records are in a table without
opening it? Some sort of property?
That's true of a recordset on a table or query. However, if
you are opening a recorset just for this purpose, it would
be much faster to use a query like:
Set rs = CurrentDb.OpenRecordset("Select Count(*) " _
& "From table/query")
numrecords = rs(0)
rs.Close : Set rs = Nothing
You could also use DCount("*", "table/query"), which will
hide the logic from your code.
For a local table, not a query or a linked table, you could
also get the record count directly from the TableDef object:
numrecords = CurrentDb.TableDefs!tablename.RecordCount