• Can you index the range of data on a page? (2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Can you index the range of data on a page? (2000)

    Author
    Topic
    #378659

    I’m wondering if it is possible to get the range of data to show in the page footer. For example, if the page happens to list names from Robert Adams to Francois Bouchard, I would like a field at the bottom of that page to say “Adams-Bouchard”. I’m hoping I can create a text field and then configure the data source for the field in some way that it will do that. Am I on the right track?

    Thanks,
    -cynthia

    Viewing 2 reply threads
    Author
    Replies
    • #627473

      I would tend to use module level variable to store the data, using the format events of the detail and page sections.

      • #627482

        Sorry. That is over my head.
        I am usually pretty good at following the instructions for how to do something in the help files – but none of the keywords I have tried to put in have led to any relevant examples.

        I do know what the format event is, and where to find it for the page and detail sections (and if I knew what the code was, I would know how to put it in there – but writing code for that from scratch would be beyond my ability). I was hoping it was going to be a simple line, similar to telling it how to put the “page 1 of 50” – but I’m guessing from your suggestion that I’m out of luck on that wish.

        -cynthia

        • #627484

          While I was typing my reply, more replies were arriving! (This is a report I am creating – phonebook style).
          I think I can follow Jayden’s second post, and I will also look at that example on the CD when I am back at the office where the CD is. Thank you very much. I’ll let you know how it turns out in the next couple days.
          -cynthia

        • #627486

          There might be an easier way (see Charlottes post). This is just the first way that came to mind.

          Once you get over the ‘scarey’ VBA stuff, it is actually not that hard

          Cheers

          Jayden

          • #627554

            [indent]


            Once you get over the ‘scarey’ VBA stuff, it is actually not that hard


            [/indent] hushmouth Shhh, Jayden! Don’t give away all our secrets! grin

          • #628096

            Thanks Jayden. I was able to figure out and use your suggestion.
            I don’t find VBA too scarey (even today – on Halloween!). I just don’t know how to do it from scratch. I generally get the wizard to start things for me and then tweak them to be what I want (but I’ve noticed that sometimes even the wizard writes code that just plain doesn’t work!), or find something in a book that is close enough to what I am trying to do that I can make sense out of the code enough to change it to what I want – and I’ve only done fairly simple things. Twice I have signed up for a class on VBA – and both times it was canceled!!! So I really appreciate the help when I can’t even figure out where to start.

            Thanks again.
            -cynthia

    • #627478

      here is an example database, open the form rptRangeExample

      The first thing to notice is that at the bottom of the page, I am using a calculated control. The control uses two functions StartName and EndName functions.

      These functions return values stored in module level variables (ie. variables that exist as long as the report does).

      The Format event of the detail section stores the current name, if the mblnStoreNextName variable is set to true (this is set to true when the report is opened and at the end of each page).

      The On Format event of the PageFooter section stores the last name in the last name variable, and sets the mblnStoreNextName variable to true (so that the name at the top of the next page will be stored).

      Hope this helps.

    • #627480

      Are you talking about a Data Access Page, a form page or a report page? Depending on your answer, you’ll get 3 different responses. If you’re trying to produce a phone directory/catalog type of report, there is an example in Solutions9.mdb on the Access CD.

      • #628094

        Well, I’ve solved the problem. Yay!
        But I couldn’t find the solutions9.mdb.
        I don’t have an Access CD, I have Office 2000 Professional. It seems like I had all kinds of sample databases on my Office 97 CD, but I couldn’t find any on the Office 2000 CD – at least nothing with the name “solutions” and nothing with a name that suggested it was a sample database. I used my Access97 samples all the time to figure things out – can I find them on the Office 2000 CD? Or are they only on the Access Standalone CD? If they are hiding somewhere on the Office2000 CD I’d love to find them!

    Viewing 2 reply threads
    Reply To: Can you index the range of data on a page? (2000)

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

    Your information: