Results 1 to 4 of 4
  1. #1
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156

    Underlining part of a string in VBA to appear in a form's text box.

    I've found a few results on this through Google, but nothing that's worked for me. I think the problem is that the strings I'm trying to do this to include < and >, and those are specifically the items I need to underline.



    I'm writing a module to take a $ value that the user enters in one text box, compare it to some pre-defined ranges, and then set the correct range into a locked text box (the ranges are to help categorize account sizes, so they do need to be ranges). The text I want to appear in the locked text box is stuff like this: ">$250K & <$750K".

    I've tried several things I found. The most recent was to convert that field to Memo, and change to Rich Text, then type in this for one of my brackets:

    Code:
        Dim repValue As Currency
        Dim Minor As String
        Dim Small As String
        Dim Mid As String
        Dim Large As String
        Dim Major As String
    
     Minor = "<u>" < "</u> & $25K"
    I haven't gotten very far with it. I wanted to make sure I had the syntax down, before writing them all. Does anyone know what I'm doing wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,960
    Review https://www.accessforums.net/access/...eld-47147.html

    Search forum on topic: html tags textbox
    User: June7

    Should see 4 more threads.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    IncidentalProgrammer is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2014
    Location
    Texas
    Posts
    156
    Maybe I'm misunderstanding, but I couldn't find how to make these characters show up in the field.

    I tried tweaking my method a little bit, and put them into a table, in hopes that I could then code it to make the right selection in a combo box that would already have the values as I want them, but I'm getting bizarre results.

    My table says ">$250K & <$750K", while my combo box pulling from it says "<div>&gt;$250K &amp; <u>&lt;</u>$750K</div>".

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,960
    Did you review the referenced thread? HTML tags only work in textbox set for Rich Text and, AFAIK, only when formatted with the Rich Text toolbar.

    Might find this of interest http://www.lebans.com/listboxenhanced.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-29-2014, 10:57 AM
  2. Replies: 7
    Last Post: 06-09-2014, 04:48 PM
  3. Replies: 8
    Last Post: 05-21-2014, 07:21 PM
  4. Returning part of a string
    By dr4ke in forum Queries
    Replies: 7
    Last Post: 01-15-2013, 11:21 AM
  5. Replies: 7
    Last Post: 02-29-2012, 06:37 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