[?] Subscribe To This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Subscribe with Bloglines


Home
Whats New!
Need a database?
Tips via email
Learn VBA
Questions Answered
Access Tips Index
What is MS Access


Vertical Alignment

This tip is a suggestion from one of Simply-Access tips subscribers.

Question

If we make a text box on a form, the text vertical alignment is always/by default Top and Left. For good looks of a form, generally we drag the corner of the text box to increase the height of the text box, in that situation the text left & top alignment does not looks good, it seems it is in corner. I wanted the textbox vertical text alignment to be in center. I was unable to do so.

To explain you the exact need of mine, I will take your attention to MS Excel worksheet. If we increase the height of a cell, then to adjust its vertical text alignment we go through the process below: Format - Cells - Alignment - Vertical option - and we select Center. This is the thing which I want for my text box on my form for a better look.

Answer

You are correct, there is not a simple way to do this in Microsoft Access, but it can still be done. You need to open the property window for the text box in question. You can do this by right-clicking on the text box and selecting ‘Properties’ from the list provided.

With the properties window open, click on the ‘Format’ tab.

You are interested in the following properties:

Text Align – Change to Centre

I know this does not help with the vertical alignment. To fix this, keep scrolling down until you find the property, ‘Top Margin’. This property positions the text a certain height from the top of the text box. Set this property to make your text appear as though it is centred vertically. It may take a bit of trial and error to get it correct. Not as simple as Excel, but achievable.

 

Do you like this tip? Subscribe to my weekly Newsletter to receive tips weekly via email. Click Here to subscribe.

footer for Microsoft Access page