Results 1 to 6 of 6
  1. #1
    RayMilhon is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,066

    Report Detail Section Size Adjustment

    I have a report that the source data includes a left outer join. If the data on the right side is null I want the size of the section to be .25 inches If the data on the right side is not I want the section to be .5 inches. The section is the 3rd Group Header the detail of the report would be the data from the right side of the join. I've already set it up so the detail section is visible only if there's data. However, I have the headings in the 3rd Group header If the data is null the headings are not displayed but theres a .25 inch gap I don't want. I thought I could just resize it in the same code that made those data elements visible or not but Access says that ME.Height is a readonly code. Can I adjust the size of a group header the way I've described or not?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I think I've dynamically sized the detail section. Your code wouldn't work, as you have to specify the section. Me refers to the report itself.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RayMilhon is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,066
    Thanks, I missed that. However, I did add the appropriate section but the height is not changing. The section I need to change is the group header 2. I have the code in the On Format event of Group Header 2. Unfortunately, Nothing changes. I know that Access uses 1440 Twips per inch at least it used to. That's why I have 1440 *.25 and 1440 *.5 to set the height has that been changed in Access 2010? I'm still missing something just not sure what. It's been a long time since I had to modify the section size dynamically.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Don't know what code you tried , but this worked in a very brief test:

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      If Me.ResID = 2 Then
        Me.Detail.Height = 1440
      Else
        Me.Detail.Height = 720
      End If
    End Sub
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    What is the report view? If memory serves (and mostly it doesn't) some? formatting events don't work for report view, but they do with print preview. Makes sense if you think about it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That's true. Drove me crazy when I first ran into it. If memory serves, the paint event works in report view.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto Size detail section
    By dmwesq in forum Access
    Replies: 2
    Last Post: 05-28-2016, 11:42 AM
  2. Replies: 6
    Last Post: 03-26-2013, 12:17 PM
  3. Increase Vertical size of detail section
    By Arsalan in forum Forms
    Replies: 2
    Last Post: 01-22-2013, 01:20 AM
  4. Limit detail section to a certain size
    By DarrenUD in forum Reports
    Replies: 6
    Last Post: 11-07-2012, 01:02 PM
  5. The length of detail section of a report
    By blueraincoat in forum Reports
    Replies: 2
    Last Post: 04-06-2011, 12:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums