Results 1 to 6 of 6

Thread: Counting Records *SOLVED*

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Counting Records *SOLVED*

    Say i've got 154 records in my table and when I scroll through the records I want to be able to display which record it is and how many records there are in the table. New records are always added to the table so the total number of records needs to change when a new record is added.

    In a label I want it to display something like.......002 of 154

    Lintz
    Last edited by lintz; Apr 9th, 2003 at 11:19 PM.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    What re you using?

    VB front end to a .mdb,

    Access (VBA),

    etc.

  3. #3

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    yeah, my app is linked to an Access DB.

  4. #4

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    Anyone got any ideas?? This is the code i've got but I can't get the current record number to display, only the record count is displayed.

    Code:
    Private Sub Form_Load()
    Label52.Caption = Format("000") & " of " & Format(datPrimaryRS.Recordset.RecordCount, "000")
    End Sub

  5. #5
    Addicted Member
    Join Date
    Nov 2001
    Location
    San Diego, CA
    Posts
    159
    Unless you need the leading 0's, just use something like this.
    VB Code:
    1. me.rs.movenext
    2. Label1.Caption = Str(Me.rs.AbsolutePosition) & _
    3. " of " & Str(Me.rs.RecordCount)
    ttfn
    Kicker

  6. #6

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Cool

    I needed to put the code behind the Next and Previous cmd buttons. It is working just how I planned it. Thanks all for your suggestions.

    Lintz

Posting Permissions

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



Click Here to Expand Forum to Full Width