CanGrow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jige
    New Member
    • Sep 2006
    • 2

    CanGrow

    All textboxes across the record are set to CanGrow, in the details section of a continuous subform of a report, yet different fields grow to varying heights and messy borders.

    Is it possible to configure all textboxes to follow the same height of their tallest peer in the same record?

    TIA!

  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Difficult.... Hard ...

    But if u create a function that updates the other fields to the len of the bigger field with intervals....

    There is a lot of calculations to do this...

    You need to know the max rows of every field and synchronize the other with...

    However with code you can do it...

    :)

    Comment

    • BoxTop
      New Member
      • Sep 2006
      • 12

      #3
      You can put a bit of code into the OnFormat event for the detail section of your report.

      If Me![TextBox1].Height > Me![TextBox2].Height And Me![TextBox1].Height > Me![TextBox3].Height Then

      Me![TextBox2].Height = Me![TextBox1].Height
      Me![TextBox3].Height = Me![TextBox1].Height

      ElseIf Me![TextBox2].Height > Me![TextBox1].Height And Me![TextBox2].Height > Me![TextBox3].Height Then

      Me![TextBox1].Height = Me![TextBox2].Height
      Me![TextBox3].Height = Me![TextBox2].Height

      ElseIf Me![TextBox3].Height > Me![TextBox1].Height And Me![TextBox3].Height > Me![TextBox2].Height Then

      Me![TextBox1].Height = Me![TextBox3].Height
      Me![TextBox2].Height = Me![TextBox3].Height

      End If


      Of course you will need to insert the actual names of your text boxes but hopefully you will get the idea. Please let me know how you get on.

      Comment

      • PEB
        Recognized Expert Top Contributor
        • Aug 2006
        • 1418

        #4
        It seems a very very good idea! :)

        But when you try it with the CanGrow property, the Height property shouldn't calculate the CanGrow option and the actual height of the field!

        I've tried a report with 2 Fields and this code:

        Code:
        Me![Key_element].Height = Me!COL01N0002.Height
        Where Me![Key_element] is placed always on one row and Me!COL01N0002 is placed always on multiple rows using cangrow property


        So to get a working function you need to know in which field what number of symbols are stored on one row with the specified formatting...

        But in this case you are doing programatical CanGrow and you can desactivize the can grow property!

        :)

        Comment

        Working...