Results 1 to 4 of 4
  1. #1
    vbclueless is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Posts
    3

    How to format a textbox to always be a bullet list - either when text typed or copied into textbox

    My form contains a textbox (with text format Rich Text) and it is a memo field from a table (on the table the field is also Rich Text). The user will either type text into the textbox or copy and paste from another textbox. At the moment the user has to select all the text and then on the ribbon's Rich Text options select to create bullets. How can my textbox be formatted to always and automatically be bulleted?

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Possibly something like this

    Code:
    strText = Replace(strText, vbCrLf, vbcrLf & " - ")
    That should give a - at the start of each line
    If you want a bullet, then use Chr(149)
    NOTE: tested using the function below but not using rich text

    Code:
    Function TestCode()
    
        strText = "Hello" & vbCrLf & "World"
        
       ' strText = Replace(strText, vbCrLf, vbCrLf & " - ")
        strText = Replace(strText, vbCrLf, vbCrLf & Chr(149) & " ")
        Debug.Print strText
        
    End Function
    You will almost certainly need to replace vbcrlf with something else for a carriage return
    E.g. Chr(13)&Chr(10) or another rich text equivalent. Possibly </DIV>???
    Last edited by isladogs; 01-31-2018 at 05:27 AM. Reason: Extra info
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    vbclueless is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Posts
    3
    Thank you! That did the job.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Excellent. Did you have to modify it for use with rich text?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 0
    Last Post: 10-06-2017, 06:22 PM
  2. Replies: 3
    Last Post: 06-24-2017, 07:37 AM
  3. Display textbox value with percent format
    By AmanKaur123 in forum Programming
    Replies: 2
    Last Post: 01-18-2017, 11:23 AM
  4. Replies: 6
    Last Post: 02-26-2016, 05:28 AM
  5. How to turn the format of a textbox back to text?
    By opopanax666 in forum Programming
    Replies: 2
    Last Post: 11-29-2012, 08:33 AM

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