Bottom aligned text...

  • Thread starter Thread starter KHV
  • Start date Start date
By manipulating the TextBox's Top property you can achieve the desired
vertical alignment. For sample code see:
http://www.lebans.com/verticaljustification.htm
VerticalJustificationA2K.zip is a database containing a function to
allow for vertical centering of the contents of a Label or TextBox
control. Works with both Forms and Reports.

Access 2000 only!

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephen,
Thank You very much. This is excactly what I needed to get onto the right
track...
I will though need to figure out how to treat longer text spanning more than
one line. How to get the text length and height and calculate the text box
top margin...
 
The code I pointed you to is a multiline solution and obviously contains
code to calculate the width and height of multiple lines of text.

Only one small change is required to modify the current vertically
centered output to vertically bottom output.

Open the sample Report in Design view.
From the Menu select View->Code
Find the Sub named "VerticallyCenter"
Change the last line to read:
ctl.TopMargin = (ctl.Height - (lngHeight + 70))

The value of 70 is 1/5 of an inch(1440 TWIPS per Inch) margin for the
bottom of the TextBox/Label control.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephen do you have a solution that would work in access 2002 or even better
any version from 2000 up?
 
You lost me Michael. The sample I referenced is an A2K MDB and will
directly convert to any later version of Access.

--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top