Results 1 to 4 of 4
  1. #1
    Nanuaraq is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    77

    How to make DLookup return formatted text

    Continuing my problem solving from another thread about DLookup providing the user with some text stored in a table.



    I succeeded in making a DLookup. I can now put a piece of text from a table into a query expression.

    My next goal is to make that formatted text.
    But, whenever I ask DLookup to retrieve text from a field where the text if formatted (RTF), then it simply retrieves the data in clean text format, with codes such as <bold> in the etx as well, instead of displaying the text in bold format.

    Is there a way for DLookup to get the content of the field in the original data format?

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Is there a way for DLookup to get the content of the field in the original data format?
    I am pretty sure that you cannot.
    Native functions, by their nature, only return values, not formatting.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    not sure if it will work with a value returned by dlookup but you need to set your textbox control text format property to rich text. This property also exists in queries - but don't believe this will be carried through to the form or report - you would have to try it and see

  4. #4
    Nanuaraq is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    77
    Thank you for information about the properties of an element in a query. But as you expected, the format doesn't carry over.
    Or rather, it does, if you're simply setting an epxression as the content of a column from a table. But using an IIf statement produces the text without the format. Thanks for trying.

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

Similar Threads

  1. Replies: 5
    Last Post: 02-24-2016, 10:58 PM
  2. iif statement - return a formatted date field
    By tennis2600 in forum Queries
    Replies: 2
    Last Post: 05-30-2015, 09:11 AM
  3. Currency formatted Text Box Question
    By data808 in forum Access
    Replies: 4
    Last Post: 05-09-2014, 12:50 PM
  4. Creating formatted body text in Ms Outlook
    By capitala in forum Forms
    Replies: 2
    Last Post: 04-24-2013, 10:20 PM
  5. Pasting formatted text into memo field
    By joekuhn in forum Access
    Replies: 0
    Last Post: 07-08-2011, 02:01 PM

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