Report Text Box

andycrfc13

New member
Local time
Today, 14:37
Joined
Aug 12, 2010
Messages
9
Currently I have a text box in a report and i was wondering if it is possible to change the height, width, top and left values and the size of the text within the text box based on a string in another textbox. The strings can be TTC, DVM, SYF etc. and are not long or complex.

The reason for this is that I insert text files into a memo field which is linked to the text box on the report. The text files are of different sizes and i would like them to be centered on the report. I cannot just centre the text as this messes with its format.
 
Hi Andy

Yes, you can change the size and position of a textbox in the Format event procedure for the section that contain it.

For example, this will centre the textbox between the left and right margins:

txtMemo.Left = (Me.Width - txtMemo.Width) / 2

The only caveat is that you cannot have Left+Width (the right-hand edge) greater than the report width and you cannot have Top+Height (the bottom edge) greater than the section height. Of course, you can adjust the section height to suit before adjusting the textbox height.

Note that you can set the CanGrow property on a textbox and it will adjust its height to suit the contents, automatically pushing down and controls below it and extnding the height of the section.

--
Graham Mandeno [Access MVP]
 
Thanks very much Graham, got that working fine!
 

Users who are viewing this thread

Back
Top Bottom