Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Height in a report (97/SR2)

    Quick question - is there a way of changing the height of the detail section on a report for each record? I tried me.Height = 1.1 and [Reports]![rptCRRrptTotalPIE].Height = 1.1 and they both returned "Runtime error 2135 Property is read only and can't be set". They were put into the "On Format" section of the detail part of the report. The database isn't read only, so its not that causing the error. Does anyone have any ideas?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Height in a report (97/SR2)

    Hi Phil,
    As far as I'm aware you cannot set the height of report sections directly at run-time. You can, however, change the height of controls on those sections, so if you set your detail section's CanShrink and CanGrow properties to True, and then change the height of the controls in the section as necessary, it should hopefully achieve the same effect.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Height in a report (97/SR2)

    Thanks for your reply Rory.
    The reason I was after changing the height of the whole section was that I have a report with pie charts that appear for some but not all records. The records with no pie chart leave quite a big gap. I tried finding a way with the shrink/grow properties but they didn't seem to work.
    I didn't quite understand what you meant by your solution: I got the shrink/grow bit okay, but by changing the height of the controls as necessary, did you mean changing the height of the whole detail section or the data and pie chart in the detail section?

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Height in a report (97/SR2)

    You need to change the height of each control in your detail section. Unfortunately you cannot programmatically change the height of the whole detail section, but Access will do that for you if you set the detail section's canshrink and cangrow properties to True. If you then set all your control heights (i.e. your pie chart and any textboxes etc) to 0 when there's no data then Access should automatically shrink the Detail section height to 0 too.
    Hope that helps?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Height in a report (97/SR2)

    Thanks Rory, I'll give it a go.

Posting Permissions

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