[AccessD] Record Count for all tables

McGillivray, Don [IT] Donald.A.McGillivray at sprint.com
Tue Mar 11 11:56:09 CDT 2008


Mark,

Something like this should get you started . . .

Dim tdf As DAO.TableDef, rsCurrent As DAO.Recordset, lngRecords As Long
For Each tdf In CurrentDb.TableDefs
    If Left(tdf.Name, 4) <> "MSys" Then
        Set rsCurrent = CurrentDb.OpenRecordset(tdf.Name)
        With rsCurrent
            If Not .EOF Then
                .MoveLast
                lngRecords = lngRecords + .RecordCount
                Debug.Print tdf.Name & " - " & .RecordCount
            End If
        End With
        Set rsCurrent = Nothing
    End If
Next
Debug.Print "Total records: " & lngRecords

If your tables are large, it may take a while, but better than poring over hundreds of pages with a pencil.

Don

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Tuesday, March 11, 2008 8:33 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Record Count for all tables


Hello All,

I need to get a record count for all tables.  I'm using Access XP.  I thought there was a way to have the documentor output to a table...but can't seem to get past the report.  The report has a record count but I'd rather not read though 100's of pages and write it down.

Any suggestions?

Thanks,

Mark A. Matte
_________________________________________________________________
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list