Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    Grass Valley, California, USA
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic text field sizing in a Report (2000 SP8)

    I have a character string that is between 0 and 255 characters long. If the string length is greater than 0, I want to include it in a text box within a report footer. While I can readily compress the footer from within VBA code to effectively remove the text box for a 0-length string, I cannot see how to easily determine the text box dimensions for a non-zero length string.

    Is there some standard conversion of "twips" per font size? If so, where might I find such a conversion table? Or is there a better way to accomplish this task...

    Thanks, Jim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dynamic text field sizing in a Report (2000 SP8)

    Try setting the Can Grow and Can Shrink properties of both the text box and of the report footer section to Yes. This affects the height of both, not the width of the text box.

    If you would like to change the width of the text box, you need Windows API calls to determine the width of the text. Frankly, I think it will be more work than it's worth. You can see an example of the code needed in another context in ACC2000: How to Limit Number of Characters to Size of Text Box.

  3. #3
    Star Lounger
    Join Date
    Jan 2003
    Location
    Grass Valley, California, USA
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dynamic text field sizing in a Report (2000 SP

    Geez, Hans, don't you ever sleep?? <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> That sounds like what I need! I'll give it a try.

    Will that property collapse the box to zero if it contains no data?

    -- Jim

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dynamic text field sizing in a Report (2000 SP

    > Will that property collapse the box to zero if it contains no data?

    Yes. You have to take care, though, not to let the text box overlap with other controls, Can Shrink doesn't work if it does. And the text box should not have an attached label, for that won't be shrunk with it.

Posting Permissions

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