how many rows in table?

T

Tcs

This is PROBABLY really easy, but since I haven't done it before...

I need to find out how to determine the numbers of rows in a table, in VBA. Is
there an easy way without having to read thru the entire table and incrementing
a counter?

Thanks in advance.

Tom
 
A

Allen Browne

Local table?
Try:
CurrentDb().TableDefs("MyTable").RecordCount

Linked table?
Try:
? DCount("*"), "MyTable")
 
A

Allen Browne

Last example has spurious bracket. Should be:
DCount("*", "MyTable")

Note to self: do not post while asleep. :)
(It's after midnight here.)
 
L

Lynn Trapp

Note to self: do not post while asleep. :)
(It's after midnight here.)

If you weren't on the wrong side of the world, you wouldn't have that
problem...<g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top