Results 1 to 4 of 4

Thread: Number of rows?

  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington (Greater Manchester area)/Cheshire, UK
    Posts
    153
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Number of rows?

    How can I determine the maximum number of rows in a table in Access 2000 using VBA?

    James

  2. #2
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    233
    Thanks
    0
    Thanked 22 Times in 21 Posts

    Re: Number of rows?

    I don't think there is a "maximum number of rows". You are limited by file size (2GB in Access 2000).

    If you mean "current number of rows", I think you have to open a recordset based on the table, move to the end, and look at the recordcount property.

    Jeremy

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Number of rows?

    Are you looking for the number of records or the table limit? If the former, you can use this:

    <pre>Public Function TableRecords(ByVal strTblName As String)
    Dim dbs As DAO.Database
    Dim tdf As DAO.TableDef

    Set dbs = CurrentDb
    Set tdf = dbs.tabledefs(strTblName)
    TableRecords = tdf.RecordCount
    Set tdf = Nothing
    Set dbs = Nothing
    End Function</pre>

    Charlotte

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington (Greater Manchester area)/Cheshire, UK
    Posts
    153
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number of rows?

    I'm looking for the number of records.

    Thanks for the help!

    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •