Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Quincy, Illinois
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count records in a Table using VB (Access 2003)

    I'm trying to identify the amount of records in a specific table using VB. For testing purposes, I would like this to pop up in a message box but also use this as a variable later.
    If someone could help me, I would greatly appreciate it.

    Thanks,
    Drew

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Count records in a Table using VB (Access 2003)

    You can use the DCount function.

    Dim lngRecordCount As Long
    lngRecordCount = DCount("*", "NameOfTheTable")
    MsgBox "There are " & lngRecordCount & " records"

    Replace NameOfTheTable with the name of the specific table.

Posting Permissions

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