Results 1 to 11 of 11
  1. #1
    nemesisswe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2021
    Location
    Sweden
    Posts
    17

    Center text in textbox (top, middle,bottom)

    Is there no way to center the text vertically in a text box? (access 2016)


    .. or have I missed something..?

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    You can centre align text from the property sheet
    However its not possible to rotate text in a textbox - it is possible in a label
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    nemesisswe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2021
    Location
    Sweden
    Posts
    17
    @isladogs that's only horizontally..

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    You can set bottom margins in textboxes, see properties.

  5. #5
    nemesisswe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2021
    Location
    Sweden
    Posts
    17
    Quote Originally Posted by davegri View Post
    You can set bottom margins in textboxes, see properties.
    Yeah, but that's not "middle", that won't change depending on lines in the box..

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Quote Originally Posted by nemesisswe View Post
    Yeah, but that's not "middle", that won't change depending on lines in the box..
    Ah so, hadn't considered multi-line data.

  7. #7
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by nemesisswe View Post
    @isladogs that's only horizontally..
    Yes I'm aware of that ... your requirements were not at all clear. That's why I asked about text rotation
    Doing this is easy....

    Click image for larger version. 

Name:	Capture.PNG 
Views:	15 
Size:	4.1 KB 
ID:	46610
    But moving the text so it is aligned centrally in a vertical direction is much harder.
    It will probably require the use of APTs and be a lot of work
    If its that important to you, I suggest you look at Stephen Lebans' website: Lebans.com
    Although it was written 20+ years ago, much of its content has never been improved since by anyone else

    Good luck
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I don't suppose you can alter the height of the textbox to suit the number of lines, padding and font sizes?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Could you just come up with an estimate of number of chars per line to estimate number of lines then use that to tweak the textbox's margin to get a faux vertical centering? Not perfect but might get you close enough?

  10. #10
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    If the lines are short and don't wrap, you could get a count of lines by counting the vbCRLFs in the string.

  11. #11
    nemesisswe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2021
    Location
    Sweden
    Posts
    17
    It's either 1 or two lines always...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-21-2019, 06:17 AM
  2. Vertical Center Text in Report Fields
    By billgyrotech1 in forum Access
    Replies: 8
    Last Post: 06-03-2019, 02:55 PM
  3. Center text vertically
    By kuku202 in forum Reports
    Replies: 1
    Last Post: 02-07-2015, 05:27 AM
  4. Need to Remove Varying Middle Text
    By EZRider in forum Queries
    Replies: 4
    Last Post: 10-10-2012, 03:45 PM
  5. Extract text from middle of a field
    By AccessNubie in forum Access
    Replies: 3
    Last Post: 11-02-2009, 01:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums