• Number Of records (2002(XP))

    Author
    Topic
    #376812

    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

    Viewing 0 reply threads
    Author
    Replies
    • #618510

      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.

      • #618528

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

        • #618548

          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.

        • #618752

          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:

          Private Sub SetRecordNum()
            'Reset the "# of #" displayed in the form footer
            Me.txtRecNum = CStr(mrst.AbsolutePosition) & " of " & mlngRecCount
          End Sub

          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.

    Viewing 0 reply threads
    Reply To: Number Of records (2002(XP))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: