Results 1 to 3 of 3
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Formatting Text Box in Columns

    I am filling in a Text Box dynamically from VBA. I want to have three columns aligned even though the Font is TrueType. Is there a way I can insert a column or position number or tab so the text starts or ends at a particular position? If the font were fixed, then it might look like this:

    Item_______________Price_______Cost
    Blue Widget________10.00_______5.00
    Red Widget________125.00______75.00
    Super Widget____3,234.23___1.654.32


  2. #2
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Formatting Text Box in Columns

    If you know the position of where you want it to start you could use the len() function to get the length of the field, take that from the above position and that's the number of spaces you need to add between. Just make a loop to add to a spaces variable.

  3. #3
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    Alex, thanks for the suggestion. In the meantime, I tried another technique that worked really well. Instead of one text box with three columns, I created three text boxes. The first had text align left and the next two with text align right. I left the formatting for all three boxes blank so I had to format the two numeric boxes with the Format function and I separated each populated row with a vbCrLf. This worked for me. Thanks again, Eddie

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

Similar Threads

  1. Formatting text of an export
    By Sarge, USMC in forum Import/Export Data
    Replies: 11
    Last Post: 02-27-2013, 09:08 PM
  2. Replies: 3
    Last Post: 02-07-2013, 09:53 PM
  3. Unbound Text Box Formatting
    By Pam Buckner in forum Forms
    Replies: 2
    Last Post: 10-14-2011, 01:31 PM
  4. Text Formatting
    By BLD21 in forum Access
    Replies: 4
    Last Post: 07-22-2011, 08:25 AM
  5. Text string formatting
    By DanW in forum Forms
    Replies: 2
    Last Post: 11-02-2009, 11:11 AM

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