Results 1 to 12 of 12
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

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

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Attached Files Attached Files

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

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

    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.
    Charlotte

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  6. #6
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  7. #7
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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 [img]/forums/images/smilies/smile.gif[/img]

    Cheers

    Jayden

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

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

    <hr>Once you get over the 'scarey' VBA stuff, it is actually not that hard <hr>
    <img src=/S/hushmouth.gif border=0 alt=hushmouth width=16 height=16> Shhh, Jayden! Don't give away all our secrets! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

  9. #9
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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!

  10. #10
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

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

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

    Sorry, I think it came with Office Developer. However, you can download it from the MS site at http://msdn.microsoft.com/library/default....mdbdownload.asp
    Charlotte

  12. #12
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Maine, USA
    Posts
    258
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Thank you Charlotte. I found and downloaded it. It looks just like the one I used to use (and love) for Access97.
    -cynthia

Posting Permissions

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