Results 1 to 10 of 10
  1. #1
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    groupheader sizing

    I have an Access 2010 Report There is a group for specific measures. Some measures contain sub-measures some don't The Report looks something similar to this

    Sub-Measures
    Adequately Controlled Blood Pressure

    Sub-measures
    Influenza Vaccination


    Measure Diabetes
    Sub-Measures
    Diabetes Eye Exam
    Diabetes HbA1c>9%
    Diabetes LDL Screening

    The database has a field to specify Whether the measure prints or not and I have the following code in the onformat event of the group header
    Code:
    If  abs(me.ckmeasureprint) = Abs(checked) Then
           me.groupheader2.Height = .17
           me.label6.visible = False
           me.text19.visible = False
           me.label21.top = 0
    Else
          me.groupheader2.height = .375
          me.label6.visible = true
          me.text19.visible = true
          me.label21.top = .2083
    End if
    In the design of the report the controls are set to the Else portion of the above If statement. When I run the report the first record prints the way I want. However, the every time the Else portion of the above if statement executes the label6.visible = true works and the me.text19.visible = true works. The Height does not change and the label21.top stays at 0. Am I missing something?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Use TWIP http://en.wikipedia.org/wiki/Twip units, example:

    '1 inch = 1440 TWIPS
    Me.boxMask.Height = 10710
    Me.boxMask.Top = 4320
    Me.tbxM1.Top = 4680
    Me.lblM1.Top = 4680
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Are the sub-measures in a subform? Reports will act this way, and only the first "record" will be affected. Access reports then assume that all pages generated from the same report will for formatted that way.
    I have built reports that hide or show certain groups and subreports depending on whether or not there is data in them, but never to hide certain controls in a report that have data in them.

  4. #4
    smithse is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    37
    Oh, and another thing too, in Access 2010 if you are using the layout grid to align controls, the sizing will not work. Remove your controls from the layout and try to see if that makes a difference.

  5. #5
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    June after I posted I realized I'd left the twips conversion off. I did that and the controls now show where they should the issue now is that the section does not resize so I still have a lot of wasted space. Roughly 200 pages given the size of the report and the number of times the blank line is printed to the report.

    Smithse do not use the layout grid. No this is a report so sub-forms or sub-reports. Just the main report with 3 grouping levels the resizing is in the 3rd level

  6. #6
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Just stepped through the code

    Code:
    If Abs(me.ckmeasureprint) = Abs(checked) Then
         me.groupheader2.height = 0.17*1440
         me.label6.visible = False
         me.text19.visible = False
         me.label21.top = 0
    Else
         me.groupheader2.height = 0.375 * 1440
         me.label6.visible = true
         me.text19.visible = true
         me.label21.top = .2083 * 1440
    End if
    Everything but the me.groupheader2.height works as expected. In both cases me.groupheader2.height shows 540 twips even though the 0.17*1440 = 244.8 not 540 so the header height is not being set in the groupheader2.format event.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What happens if you make the groupheader2.Height setting after the label21.Top = 0?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    I got it working but not real clear why.

    What I noticed is that .017 *1440 = 244.8 and .375 * 1440 = 540
    so I changed the .017*1440 to Round(.017*1440,0)+1 and the resizing worked. I'm guessing that the decimal did not allow the resizing to work but No error was generated it just left the setting at 540 doesn't make sense to me but it's working and instead of 768 pages I'm printing 559

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Odd, I have TWIPS with decimal and doesn't appear to cause issue.

    BTW, just in case you ever need it, .Left would be in inches, not TWIPS (don't ask me why!).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    I know I've used it before never been an issue until this time. No clue why, but it works. As for the .Left in inches, Not TWIPS. Why? (JK)

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

Similar Threads

  1. Form Sizing
    By Deanos in forum Forms
    Replies: 1
    Last Post: 07-30-2011, 08:45 AM
  2. Sizing of a report
    By ETCallHome in forum Reports
    Replies: 7
    Last Post: 06-25-2011, 10:51 PM
  3. Sizing and positioning
    By 161 in forum Database Design
    Replies: 1
    Last Post: 04-09-2011, 10:52 AM
  4. Access Form Sizing
    By AccessFreak in forum Forms
    Replies: 2
    Last Post: 12-31-2010, 11:56 AM
  5. Pictures sizing
    By newtoAccess in forum Access
    Replies: 0
    Last Post: 11-22-2009, 10:10 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