Adapt Lebans' AutoSizeFont\AutoSizeFontVer2.mdb tools to report?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MLH

    Adapt Lebans' AutoSizeFont\AutoSizeFontVer2.mdb tools to report?

    Was hoping to make use of AutoSizeFont\Au toSizeFontVer2. mdb
    procedures to auto-resize fonts in a textbox control on a report when
    the fixed physical size of the textbox was insufficient to display all
    the text in the source table's memo field. One could, I suppose,
    simply count the displayable chars at various acceptable fontsize
    settings and use If-Then or Select Case to effect an appropriate
    change.

    But Lebans' solution, I think, is a more elegant one. I'm just not
    sure I can make it work with reports.
  • Marshall Barton

    #2
    Re: Adapt Lebans' AutoSizeFont\Au toSizeFontVer2. mdb tools to report?

    MLH wrote:
    >Was hoping to make use of AutoSizeFont\Au toSizeFontVer2. mdb
    >procedures to auto-resize fonts in a textbox control on a report when
    >the fixed physical size of the textbox was insufficient to display all
    >the text in the source table's memo field. One could, I suppose,
    >simply count the displayable chars at various acceptable fontsize
    >settings and use If-Then or Select Case to effect an appropriate
    >change.
    >
    >But Lebans' solution, I think, is a more elegant one. I'm just not
    >sure I can make it work with reports.

    Check the samples in the mdb file. They demonstrate the
    code for what you want (which is the same for reports and
    forms).

    The code you're looking for will be vaguely like:

    For Me.textbox.Font Size = 12 To 4 Step -1
    If fTextHeight(Me. textbox) < Me.textbox.Heig ht _
    Then Exit For
    Next

    --
    Marsh

    Comment

    Working...