[AccessD] How to make a textbox grow to accommodate text on Access form
Bill Benson
bensonforums at gmail.com
Tue Jul 11 02:11:54 CDT 2017
One off.
I have just made 10 textboxes with transparent background with same height
and visible =false (for all but first one) and AL with same .Top value. On
Open I parse the OpenArgs, and run a parsing routine to break up the text
by line feed characters, filling in the other textboxes according to what
is warranted by virtue of hard returns, making visible the ones needed. And
adjust the detail height upwards by the height of each textbox made visible
this way. It's a kludge but it meets my needs.
Given the number of Google posts on this with extremely few responses other
than Steve Lebans method (which I can't open in a recent version of access)
I am going to assume this is not a simple no brainer, and I withdraw the
question, because I don't have that much need.
Thanks Stuart.
>From my non-flammable Note 3,
Bill Benson
On Jul 10, 2017 9:57 PM, "Stuart McLachlan" <stuart at lexacorp.com.pg> wrote:
> How is the textbox being populated? Is it one-off when the form is opened
> or does it get
> re-populated after the form is displayed?
>
>
> On 10 Jul 2017 at 21:34, Bill Benson wrote:
>
> > I would like to make a textbox, which starts fairly short, expand in
> > size to accommodate a wad of alert text on an alert form. There is no
> > reason for the form to grow in size nor the textbox that is displaying
> > the alert, to be too tall unnecessarily.
> >
> > But the CanGrow property is not helpful since it is relevant to
> > printing only.
> >
> > I have tried to leverage a report with a control that mirrors the
> > textbox on the form, in terms of font and so forth, thinking that I
> > could rely on success I have had making fields on reports grow, but
> > this seems to be beyond my skill to make the form and the report work
> > in concert. I need the report to pop open (only temporarily) and then
> > send it the font characteristics and text of the form's textbox, and
> > then read the "new" height - but there doesn't appear a way to make
> > the Report's events fire with any degree of reliability. I am not even
> > sure which event I would use anyway, since on Open, even changing the
> > value of the textbox (and it is in the Detail section, which is the
> > only section where it can be made to grow) does not seem to have an
> > impact in that event. But I have tried Current and Detail_Format and
> > they don't seem to work either.
> >
> > Not a lot more to say, except this, that the times where on another
> > report I need a similar reporting field to flex, that was all done in
> > the Open event of the report, and it seemed to work just fine then,
> > however I was exporting the report and so I think the size
> > characteristic was adapting to the needs of the text because
> > precisely, the report was being output. But, pretty sure I saw the
> > field adjusting in size even when opened in normal report view. So it
> > all has be a little confused.
> >
> > I think that even having to leverage a report is kinda stupid, but
> > looking around on the internet I have not found anything that seems to
> > flex controls except some databases created by Steve Lebans and which
> > I downloaded but alas, with too recent a version of Access (2013) I am
> > not able to open his sample database.
> >
> > Thanks for suggestions that make this happen!
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list