How to Set Vertical Text in Access?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Key
    New Member
    • Aug 2010
    • 132

    #1

    How to Set Vertical Text in Access?

    Hi!
    Vertical text when placed in a report is read from top to bottom,
    is it possible to have vertical text so it's read from bottom to top
    (rotated 180 degrees from the default)?
    Example.
    I am working with 2010. In the report if you select yes in the properties for vertical it does place it Vertical.
    However, it places text so the bottom of the text aligned with the
    left edge of the paper; my question is,
    Is there a way to align it with right edge of the paper?
    ie. I want the word HOME to read like
    Code:
    E
    M
    O
    H  this is Bottom to top
    
    and Not like
    H
    O
    M
    E   this is top to bottom, ofcourse with the text aligned 90degree
    IS this possible in access?
    Please help!!!!
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    As a last resort, you can accomplish this with Code in the Format() Event of the Detail Section. If you are interested, let me know and I'll Post the Code.

    Comment

    • Mr Key
      New Member
      • Aug 2010
      • 132

      #3
      Yes indeed I am!
      With any cost!!!

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        The key to making this work, and look presentable, is to:
        1. Set the Can Grow Property of the Text Box displaying the Vertical Text ([txtLNameVer]) to Yes.
        2. Using a Fixed Width Font for the Text Box displaying the Vertical Text, in this case I used Courier New.
        3. The Code in the Format() Event will do the rest of the work in displaying the Text in Reverse, Vertical Format, for the [LastName] Field.
        4. Download the simple Attachment that I have created for you to see all this in action.
        5. The Code the Detail_Format() Event is as follows:
          Code:
          Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
          Dim strLast As String
          Dim intCtr As Integer
          Dim strBuild As String
          
          strLast = Me![LastName]
          
          For intCtr = Len(strLast) To 1 Step -1
            strBuild = strBuild & Mid$(strLast, intCtr, 1) & vbCrLf
          Next
          
          Me![txtLNameVer] = Left$(strBuild, Len(strBuild) - 2)
          End Sub
        Attached Files

        Comment

        • Mr Key
          New Member
          • Aug 2010
          • 132

          #5
          Thanks!
          I couldnt open the db,
          Give me the meaning of each applied code, line by line and word by word for the sake of learning so that I can play with.
          You may start from
          Code:
          For intCtr = Len(strLast) To 1 Step -1
            strBuild = strBuild & Mid$(strLast, intCtr, 1) & vbCrLf
          Next
           
          Me![txtLNameVer] = Left$(strBuild, Len(strBuild) - 2)
          End Sub
          I have tried to learn on my own but couldnt make it.
          Thanks!!!

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            1. Starting at the end of the String, and ending at the beginning, read each character, add it to a pre-existing String (strBuild), then add a CR/LF (Carriage Return/Line Feed) after each character so that they appear on different lines.
              Code:
              For intCtr = Len(strLast) To 1 Step -1 
                strBuild = strBuild & Mid$(strLast, intCtr, 1) & vbCrLf 
              Next
            2. Strip the Trailing CR/LF from the String (strBuild) that has been built, and assign this Value to the Text Box Control ![txtLNameVer] that will contain this String which will be the Last Name for each Record in Reverse, Vertical order.
              Code:
              Me![txtLNameVer] = Left$(strBuild, Len(strBuild) - 2)
            3. I cannot understand why you cannot Open the Demo Database, what Error are you getting when you try to do so?

            Comment

            • Mr Key
              New Member
              • Aug 2010
              • 132

              #7
              Thanks alot! Finally I got the point and it works!
              Thanks

              Comment

              • ADezii
                Recognized Expert Expert
                • Apr 2006
                • 8834

                #8
                You are quite welcome.

                Comment

                Working...