Results 1 to 3 of 3
  1. #1
    ohmydatabase's Avatar
    ohmydatabase is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2017
    Posts
    79

    Rich Text Not Displaying Correctly (Unordered List)

    Hey all,

    I have a textbox with the "RichText" property set. Within VBA, I assemble a string with html tags using queries and some if/else logic. When I set the value of my textbox to this string I get some extra things I wasn't expecting. I am assembling a tiered bulleted list. If I paste my html string into http://htmledit.squarefree.com/ it get exactly what I was hoping for. (This site just displays the html that you provide) But in Access, I get extra bullets at the end of each of my lists... It seems that my html correct, but I was wondering if Access has some special quirk to it that I haven't yet discovered.

    The html String:
    <b> <u> Vacation / Travel Time: </u> </b> <br/>
    <ul>
    <li> 6/5/2017 - 6/9/2017 </li>
    </ul> <br/> <br/>
    <b><u> Actuators Modeling and Simulation Group - General </u></b><br/>
    <ul>
    <li>test g3</li>
    <li>test g2</li>
    <li>test g1</li>
    <li><b><u> test mission 1 </u></b>


    <ul>
    <li>teszt 1.1
    <ul>
    <li>test 1.1.1</li>
    </ul>
    </li>
    </ul>
    </li>
    <ul>
    <li><u>tes task 1</u>
    <ul>
    <li>1.1.2
    <ul>
    <li>1.1.2.1</li>
    </ul>
    </li>
    <li>test 1.1.1
    <ul>
    <li>1.1.1.1</li>
    <li>1.1.1.2</li>
    <li>1.1.1.3</li>
    </ul>
    </li>
    </ul>
    </li>
    </ul>
    <li><b><u> test mission 2 </u></b>
    <ul>
    <li>1.2.1
    <ul>
    <li>1.2.1.1</li>
    <li>1.2.1.2</li>
    </ul>
    </li>
    </ul>
    </li>
    </ul>

    What Access gives me:
    Click image for larger version. 

Name:	htmlHelp.png 
Views:	10 
Size:	10.0 KB 
ID:	28618

    What the above website gives me:
    Click image for larger version. 

Name:	htmlHelp2.png 
Views:	10 
Size:	8.9 KB 
ID:	28619

    (Ignore the missing Vacation bit in the website picture)

  2. #2
    ohmydatabase's Avatar
    ohmydatabase is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2017
    Posts
    79
    Update: It appears that Access adds html tags to the string when I place it into the textbox. It also adds things like <div>, &nbsp;, and </div>
    I cant find anyone that can explain this behavior. It must be something to do with how Microsoft has the textbox set up

  3. #3
    ohmydatabase's Avatar
    ohmydatabase is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2017
    Posts
    79
    Answer:

    So Access is very picky about the html that it reads in. The source that I learned html from groups child lists within the list item of the parent bullet.

    Example:
    <li>Pastries
    ____<ul>
    ________<li>Croissant</li>
    ________<li>Mille-feuille</li>
    ________<li>Palmier</li>
    ____</ul>
    </li>


    Access does not like this. It will attempt to add extra html tags to put it in the form it wants. In doing so, it will add things that will cause the display to be incorrect. To fix this, the termination of the parent bullet must occur before the child bullet.
    Example:
    <li>Pastries</li>
    ____<ul>
    ________<li>Croissant</li>
    ________<li>Mille-feuille</li>
    ________<li>Palmier</li>
    ____</ul>

    The output from earlier:
    Click image for larger version. 

Name:	htmlAns.png 
Views:	10 
Size:	9.7 KB 
ID:	28623

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

Similar Threads

  1. Replies: 4
    Last Post: 08-07-2015, 07:49 AM
  2. Replies: 15
    Last Post: 01-07-2015, 02:10 PM
  3. Forms not displaying correctly on monitor 2
    By Perceptus in forum Forms
    Replies: 2
    Last Post: 11-06-2014, 01:45 PM
  4. Displaying Queries Correctly
    By cgjames in forum Reports
    Replies: 0
    Last Post: 01-18-2011, 06:54 PM
  5. Replies: 2
    Last Post: 09-16-2010, 06:12 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