Results 1 to 6 of 6
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Controls moving up in detail section of report (Access 97)

    I have a report with 10 fields going down the page in the detail section. I want to see if the 3rd control down is empty and if so to not show that field and move all the fields below it up one place.
    I have thought about using 2 reports, one with the field and one without.
    I have also thought i could set the Top property of the controls below it to raise them this way.

    Is there easier way?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls moving up in detail section of report (Access 97)

    Set the Can Shrink property to Yes for both the 3rd control down and for the detail section.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Controls moving up in detail section of report (Access 97)

    I tried that Hans and that didn't work.

    All 10 controls are on the same record, they are setup vertically on the page, not horizontally.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Controls moving up in detail section of report (Access 97)

    I would expect Hans' suggestion to work.

    It is important that the controls do not overlap each other.

    You don't mean that you have set the vertical property of the controls to yes do you? Each control runs across the page but they are beneath each either.
    Regards
    John



  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controls moving up in detail section of report (Access 97)

    John's remark that there should be no overlap between the controls is important - Can Shrink will not work if they do. So make sure that there is a tiny gap (if only of 1 pixel) above and below the control that could be empty. Also, the control that could be empty shouldn't have a label. If it does, you need to add a bit of code:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.NameOfLabel.Visible = Not IsNull(Me.NameOfControl)
    End Sub

    This will hide the label if the control is empty, allowing the controls below it to move up.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Controls moving up in detail section of report (Access 97)

    I'll check out that overlap. Thank you gents.

Posting Permissions

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