Results 1 to 7 of 7
  1. #1
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84

    Can grow - how to make all fields grow when only one grows due to more data?

    I have 5 multiple fields or text boxes in a row in a report.

    I have all of the fields set to “can grow”. However, when field 2 has a lot of data the field grows accordingly, but the rest of the fields do not. Consequently 4 fields are the normal size but the 1 field is larger. I also have borders on each of the fields.

    Thanks,



    John

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Simple answer : Put a single text box around the whole set of controls in that group.

    Complicated answer : You can get the height of the section or the known largest control, and in the on format event with VBA you can extend the other controls height to match it.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Or remove the control borders and it should look 'perfect'. Control borders in reports just make for overly busy/cluttered display IMO.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84
    Thanks. What would the VBA code be?

    John

  5. #5
    jmuirman1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2016
    Posts
    84
    Thanks. I would, but the report has to match exactly one from another company which has borders.

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by jmuirman1 View Post
    Thanks. What would the VBA code be?

    John
    I did say this isn't simple.
    You need to identify the tallest control - if you only really have one control that will grow then in the OnPrint event you need to get it's height, and set the other controls to match it.
    So let's assume field 2 is in a control call txtLargeData.

    This is air code (untested) and you will need to change the made up control names to match your reports control names.
    Something like
    Code:
    Dim lgLargeHeight as Long
    
    lgLargeHeight = Me.txtLargeData.Height
    
    Me.txtOtherField1.Height = lgLargeHeight 
    Me.txtOtherField3.Height = lgLargeHeight 
    Me.txtOtherField4.Height = lgLargeHeight 
    Me.txtOtherField5.Height = lgLargeHeight
    If it doesn't work, post back exactly what you wrote as code and either highlight the error line or show us pictures of the formatting going wrong.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    And that one is dynamic and is an Access report? Then copy the design?
    Or perhaps you meant it was in some other form, such as Word, wherein all table cells increase in height when just even one does.

    I don't think the single control idea will work for you - you'd get outer vertical border that will increase in height, but if you have borders in between (on each other field) their vertical borders won't grow. I'm a little rusty on this subject, but I thought the cangrow property only takes effect when printing. That is true of forms, but maybe not for reports. Anyway, your question has been asked many times by many others and solutions were accepted. Perhaps this one will work for you.
    https://stackoverflow.com/questions/...oring-controls
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2018, 09:31 AM
  2. Vertical Line grows when when fields grow
    By trident in forum Reports
    Replies: 4
    Last Post: 04-28-2016, 02:25 AM
  3. Auto shrink/grow fields
    By Thompyt in forum Forms
    Replies: 10
    Last Post: 10-26-2014, 04:35 PM
  4. Replies: 1
    Last Post: 10-10-2012, 12:25 PM
  5. Make a Rectangle Grow with Textbox
    By newbie in forum Reports
    Replies: 2
    Last Post: 10-19-2010, 05:50 PM

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