[AccessD] How to make a textbox grow to accommodate text on Access form

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jul 10 20:56:14 CDT 2017


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
> 




More information about the AccessD mailing list