Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old March 25th, 2004, 03:54 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe try the Top Margin property of the label--if the text is not dynamic, you can effectively use that property to vertically center the text.

Reply With Quote
  #12 (permalink)  
Old March 25th, 2004, 04:46 PM
Authorized User
 
Join Date: Mar 2004
Location: , , Latvia.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by aelwell
 Maybe try the Top Margin property of the label--if the text is not dynamic, you can effectively use that property to vertically center the text.

Well, read my previous post, aelwell!

But thanks for trying! :)

eyedam

Reply With Quote
  #13 (permalink)  
Old April 9th, 2008, 06:50 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Janise,
I know this is an old thread, but I believe I have found a good workaround for this problem which might help other people. I had pretty much the same problem and ended up "washing up to shore" here at this forum a little while ago.

Microsoft applications like Access and Word do this crazy thing where they annoyingly automatically center text within inline (non-floating) labels - but they don't really have a "vertical alignment" option that I know of - so the label text is always just higher than everything else (ARG!!!); However, it is possible to chop off some of the excess space below the text in a label so it looks like the text is perfectly inline (haHA!).

In WORD I do this (probably same for Access too):
Note: This is for Times New Roman 12pt font. You might have to crop a little more or a little less with a different font and size!

             1. Go to View->Toolbars->Visual Basic (adds the VB toolbar - leave alone if already checked)

             2. Click on the symbol with a blue triangle, ruler and pencil to go into "Design Mode". If you're already there: ok good.

             3. Right-Click on the label you want to format - and select "Format Control..."

             4. A window named "Format Object" should pop up and you should be in the "Picture" tab. It should say "Crop from" in the window and in the "Bottom:" field type 0.09". Yes that's 9/100 inches. Press OK. (You're cropping 0.09" off the bottom of the label - which I think is about 6 or 7 pixels [if your resolution is 1280x800? - not important]).

             5. The text in the label will look really weird and distorted at first. That's ok. Click on the same Blue triangle/ruler/pencil icon again to exit "Design mode" and everything should fall nicely into place.

This is some VB script that I think will do pretty much the same thing for those crazy VB people (I like Java and C++ but who cares). Atleast this is what the macro recorder doohickey spit out when I did the above steps.

Sub YourMacroNameHere()
Selection.InlineShapes(1).PictureFormat.CropBottom = 6.48
End Sub


Hope that helped ;)

I need some coffee.
Reply With Quote
  #14 (permalink)  
Old May 11th, 2008, 02:05 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by janise
 Hello!

Is it possible to align text vertically in MS Access reports?

Thanks,
Janis
Hi Janise, in 2004 you posted the query above. Just wondering if you have ever found a workable solution for it? I'm now stuck in the exact same situation, any help would be immensely appreciated.

Alex

Reply With Quote
  #15 (permalink)  
Old November 20th, 2008, 05:43 PM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its not elegant but this is what i did

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)


'only works up to 10 line addresses

    ' find how many lines in address
    Dim n As Integer
    Dim m As Integer
    n = 0
    Dim lastposition As Integer
    Dim WorkAddress As String
    Dim LeadingBlanks As String

    ' remove double lines and truncate trailing lines
    WorkAddress = Replace(Trim(Me.Address), vbCrLf & vbCrLf, vbCrLf)

    ' count lines
    lastposition = 1
    Do
        lastposition = InStr(lastposition + 1, WorkAddress, vbCrLf)
        n = n + 1
    Loop Until lastposition = 0

    ' add leading blanks to make all addresses take up 10 lines
    LeadingBlanks = ""
    For m = 10 To n Step -1
        LeadingBlanks = LeadingBlanks & vbCrLf
    Next

    ' diaplay address with leading blanks
    Me.TxtAddress = LeadingBlanks & WorkAddress

End Sub


Reply With Quote
  #16 (permalink)  
Old November 20th, 2008, 05:44 PM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its not elegant but this is what i did

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)


'only works up to 10 line addresses

    ' find how many lines in address
    Dim n As Integer
    Dim m As Integer
    n = 0
    Dim lastposition As Integer
    Dim WorkAddress As String
    Dim LeadingBlanks As String

    ' remove double lines and truncate trailing lines
    WorkAddress = Replace(Trim(Me.Address), vbCrLf & vbCrLf, vbCrLf)

    ' count lines
    lastposition = 1
    Do
        lastposition = InStr(lastposition + 1, WorkAddress, vbCrLf)
        n = n + 1
    Loop Until lastposition = 0

    ' add leading blanks to make all addresses take up 10 lines
    LeadingBlanks = ""
    For m = 10 To n Step -1
        LeadingBlanks = LeadingBlanks & vbCrLf
    Next

    ' diaplay address with leading blanks
    Me.TxtAddress = LeadingBlanks & WorkAddress

End Sub
Reply With Quote
  #17 (permalink)  
Old February 3rd, 2016, 02:42 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default It is possible to set the vertical alignment of Text box or label in MS ACCESS

It is possible to set the vertical alignment of Text box or label in MS ACCESS.
Select the Text box or Label and Go to Porperties , Then Scroll down to the TopMargin and set its value to 0.2 or 0.3 depending on your text box or label size..

Thanks

Alam Shehzad
Pakistan
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vertical-align problems chroniclemaster1 CSS Cascading Style Sheets 0 September 3rd, 2008 12:07 PM
Vertical Labels bfoley CSS Cascading Style Sheets 2 November 26th, 2007 02:06 PM
EASY Q: Left-Align and Right-Align DIV? panuvin ASP.NET 1.0 and 1.1 Basics 0 December 16th, 2006 02:02 AM
Vertical alignment for a formula Slon Crystal Reports 1 April 16th, 2006 01:46 AM
Vertical Menu Niaz Pro VB 6 2 October 14th, 2003 06:03 AM



All times are GMT -4. The time now is 03:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.