Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Massachusetts, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Number Of records (2002(XP))

    I want to create a field on a form that will display the total number of records. I am in popup and don't want to use the record indicator with nav buttons that is built in

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number Of records (2002(XP))

    I'm not clear on your pop-up reference's effect, but in general:
    On the form, place an unbound textbox with the following Control Source: =Count([Your key field])
    That will display the number of records in the source that the form is based on.

  3. #3
    Star Lounger
    Join Date
    Jan 2002
    Location
    Massachusetts, USA
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number Of records (2002(XP))

    That worked great. Thank You. Could I also make a text box that displayed the current record #

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number Of records (2002(XP))

    I have not done this before, but I did find Record Navigation Sample. It sounds as if it may contain the functionality you are looking for.

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

    Re: Number Of records (2002(XP))

    Are you using DAO or ADO? The download from Roger's website uses DAO, and in AXP that would require your setting a DAO reference before you could use that approach. Using and ADODB recordset, you can do it like this:

    <pre>Private Sub SetRecordNum()
    <font color=448800> 'Reset the "# of #" displayed in the form footer</font color=448800>
    Me.txtRecNum = CStr(mrst.AbsolutePosition) & " of " & mlngRecCount
    End Sub</pre>


    In this case, txtRecNum is the name of an unbound textbox in the form footer that displays the current record number, mlngRecCount is a module level variable that holds the total number of records in the recordset, and mrst is the ADODB recordset object. The sub gets called from various routines in the form to keep the textbox in sync with the position in the recordset.
    Charlotte

Posting Permissions

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