Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Keep group of controls together on report (2000sr1a)

    I am trying to keep a group of controls within a section together on a report, and am struggling to do so. I have a list of individuals in a village, which need to be grouped in households and 3 blank lines printed at the bottom of each family to add new members in the field. This I can do, as keeping the group1 footer with group1 is not too disastrous in terms of space. The problem comes in that I need to print space for 10 new families, each with 10 members, at the end of the list for each village. This will obviously not fit on one page, but I don't want each new family split over a page. So I'd like each group of 10 lines together. At the moment most of the controls are labels - just to create a grid, as they'll obviously have no data in, and I've tried grouping them, to no avail, and putting dummy text boxes in with the labels far enough away that if the label and text box were to be printed together all 10 lines would have to be, also to no avail.

    I've thought about trying to use a subreport, which would also give me more flexibility in terms of the number of new families I could add, which at the moment is limited by the number of controls on a report, but it's not entirely clear to me how I would control the record source of this. There is one additional problem in that at the moment, I am quite successfully managing to run the household number on from the last in the village, and I fear that would be more complicated if I created the subreport.

    So, just to clarify, the basic structure is this:

    Last member of last family:

    ID Household number Name Age
    New member line
    New member line
    New member line

    Label: New family 1
    Blank ID Household number+1 Blank Name Blank age
    New line as aboveX10

    Label: New family 2
    Blank ID Household number+2 Blank Name Blank age
    New line as aboveX10

    etc for 8 more families.

    I may be being stupid - it's been a while since I played with access at all, let alone with reports. I'd appreciate either any suggestions as to how to keep each new families' controls together on a page, or suggestions for restructuring which would make doing that easy.

    Thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keep group of controls together on report (2000sr1a)

    Maybe not the most elegant manner.
    Create a dummy table of 10 families with 10 members (100 records).
    Create a report based on the dummy table that looks like you want.
    Use that report as subreport in the footer of the Village.
    Attached a little db with a sample of what I mean.
    Attached Files Attached Files
    Francois

  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Keep group of controls together on report (2000sr1a)

    Thanks Francois,

    That works to keep the controls together, but, as expected, as soon as I jump into the subreport I can no longer access Max([Household Number]) - all expressions involving this, however explicitly referenced, resulting in an error. I could try and link the subreport to a series of calculated values for Max([Household Number])+1, +2 etc, but it's not clear to me that this would work either, as it would be a many to many relationship. Even if it did work, there would be a large overhead involved, as the villages have between 60 and 300 households. That's a big table for a dummy!

    Ah! Maybe I have it. Seems to work with using a label for household number, your tabledef for familyID and putting

    lblHousehold.Caption=Str(rptVillage!txtMaxHousehol dValueHolder+FamilyID)

    in the on format event of the subreport's source report.

    Now lets see if this continues to work.

    Thanks

Posting Permissions

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