Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2004, 03:54 PM
Registered User
 
Join Date: Mar 2004
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.

 
Old March 25th, 2004, 04:46 PM
Authorized User
 
Join Date: Mar 2004
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

 
Old April 9th, 2008, 06:50 PM
Registered User
 
Join Date: Apr 2008
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.
 
Old May 11th, 2008, 02:05 AM
Registered User
 
Join Date: May 2008
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

 
Old November 20th, 2008, 05:43 PM
Registered User
 
Join Date: Nov 2008
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


 
Old November 20th, 2008, 05:44 PM
Registered User
 
Join Date: Nov 2008
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
 
Old February 3rd, 2016, 02:42 AM
Registered User
 
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.