Results 1 to 4 of 4
  1. #1
    mathanraj76 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    39

    records number shows in label

    Hi..



    I need help

    How to show records number on label in ms access

    For an example
    Total records in my table 20
    I'm in records number 5
    So..it's should show me "5 of records 20" in the label

    when i click next button,previous button,first button and last button the records number must follow up ..


    Thanks
    MathanRaj

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    First you have to force Access to load the entire RecordSet, something the Access Gnomes don't always do when a Form first opens:

    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acLast
      DoCmd.GoToRecord , , acFirst
    End Sub

    Then to update the count as you move from Record-to-Record:

    Then
    Code:
    Private Sub Form_Current()
      Me.LabelName.Caption = "Record  " & CurrentRecord & "  Of  " & RecordsetClone.RecordCount & "  Records"
    End Sub


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    mathanraj76 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    39

    Cool

    Quote Originally Posted by Missinglinq View Post
    First you have to force Access to load the entire RecordSet, something the Access Gnomes don't always do when a Form first opens:

    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acLast
      DoCmd.GoToRecord , , acFirst
    End Sub

    Then to update the count as you move from Record-to-Record:

    Then
    Code:
    Private Sub Form_Current()
      Me.LabelName.Caption = "Record  " & CurrentRecord & "  Of  " & RecordsetClone.RecordCount & "  Records"
    End Sub


    Linq ;0)>
    Thanks ..
    You have solved my problems
    I'm still new in ms access and I need to learn more with expert like you..
    Once again Thanks..

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Good luck with your project!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 01-24-2013, 10:02 PM
  2. Subreport shows all records
    By wubbit in forum Reports
    Replies: 6
    Last Post: 04-05-2012, 07:04 AM
  3. Replies: 14
    Last Post: 02-23-2012, 06:32 PM
  4. Replies: 8
    Last Post: 01-19-2011, 04:48 AM
  5. Replies: 3
    Last Post: 12-23-2009, 08:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums