tags:

views:

77

answers:

2

Using Access 2003. On a subreport I have arranged a row of text boxes that will be populated with dynamic data. (These will appear as column headers on a master report.) Due to report constraints, the text boxes are tall and somewhat thin; some incoming strings will be longer than other strings; strings are expected to wrap when necessary. Presently, each of these text boxes is bottom-aligned.

What I am looking for is a way to force the text in each of these boxes to be bottom-aligned, to grow upward as it were. As we know, Excel natively allows bottom alignment in a cell; I do not see that Access offers a similar capability. Any hints? A VBA technique maybe? Thanks.

+2  A: 

TonBill,

You can use VBA to set TopMargin property of each textbox to a certain value; TopMargin will "move" text down towards the bottom. You will have to calculate each TopMargin based on how many characters including spaces fit in one line of each textbox. Not a great solution, but may work.

I don't think there is a configuration option in Access for bottom text alignment. See this: http://www.eggheadcafe.com/software/aspnet/35318427/how-can-i-bottom-align-te.aspx

Meringros
This suggestion actually works very well. Rather than spend the time to work out a calculation function, I derived empirically the top margin factor for each of my cases (there are fewer than 10) and stored each one by case in a table so they are available at report-build time. Remember to use a twips conversion in the VBA code...
TonBill
A: 

Since its a report. Check out the CanGrow property

If you have the text bottom aligned, just set the CanGrow Property for all the textboxes, and the textbox will dynamically grow to fit the text in the report.

Here is some info on the CanGrow property: http://msdn.microsoft.com/en-us/library/bb242179.aspx

Fink