Results 1 to 4 of 4
  1. #1
    NewbieInCT is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    20

    Bold search terms in Query result for report

    I have a query and a subsequent report that searches my table. The Parameter is called [all] and I get a popup box to enter my search term.

    Is there a way to have the Report bold, underline, change the color, etc of the found word? to take it a step further, is there a way to say if found alone, to bold and change to red, and if found within another word, to bold green and underline?

    An example would be Tent. If I search for Tent: I would want it to Bold and Red when found tent, but bold, green and underline when it finds retention.



    my codes for the query is
    Code:
     SELECT [Consolidated Denied Party Report].*, [Consolidated Denied Party Report].[26]
    FROM [Consolidated Denied Party Report]
    WHERE ((([Consolidated Denied Party Report].[26]) Like "*" & [All] & "*"));
    The report was created via wizard based off the query....

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Calculate another value in query:

    FoundCode: IIf([26]=[All],1,2)

    Then use textbox conditional formatting to set the display according to FoundCode.
    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
    NewbieInCT is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    20
    June, Sorry for the long lag. Where in my VBA code would I put this? would it be in the SQL query viewer part, or in the Altf11 area?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That is not VBA code. It is intended to create a field in query with expression. The constructed field can be referenced same as any field in the query. Set Conditional Formatting of textboxes from the Format tab of the ribbon.

    Setting formats on partial strings of text data is not easy. That would require VBA code, Rich Text Format, and HTML code tags.
    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. multiselect listbox - search result problem
    By svartisya in forum Forms
    Replies: 4
    Last Post: 11-29-2011, 07:17 AM
  2. Open report from query result
    By shank in forum Programming
    Replies: 11
    Last Post: 10-04-2011, 12:59 PM
  3. Search engine result database suggestions
    By PIHA520 in forum Access
    Replies: 0
    Last Post: 05-29-2011, 05:44 PM
  4. Binding a Combo Box Search Result
    By cvansickle in forum Forms
    Replies: 2
    Last Post: 12-06-2010, 11:03 AM
  5. Replies: 1
    Last Post: 10-29-2010, 10:46 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