Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Location
    Elk Grove, CA
    Posts
    1

    How to format text in a report

    I have a report that has about 50 different descriptions. Is there a way to single out certain ones and make them bold. The conditional format does not have enough items to use it as I have about 15 descriptions that I need to change the format to bold and highlight if possible.
    Thanks very much for the help.
    Mike

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Mike,

    Are you saying, "if [MyDescr] is one of 15 value, bold it; otherwise make it un-bold", open your report in design mode, select the report section with that control, and from properties window's Events tab click in the box for the Format event. Two buttons should show up to the right; click the one with '..' select code builder.

    You will be moved to the VB Editor. It will start you off with code looking like this:

    Code:
    Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
    
    End Sub
    <swap out GroupHeader2 for the section you selected. Inside those lines, add code like this:

    Code:
        Select Case Me![MyDescr]
            Case "a", "b", "c", "d"
                Me![MyDescr].FontBold = True
            Case Else
                Me![MyDescr].FontBold = False
        End Select
    Update the code so that the field name matches, and so that the list of values is correct.

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

Similar Threads

  1. Keeping text in a report textbox
    By Hawkx1 in forum Reports
    Replies: 2
    Last Post: 11-13-2008, 04:11 PM
  2. Write text to text box on a form
    By DKY in forum Programming
    Replies: 0
    Last Post: 10-08-2008, 11:34 AM
  3. Split text field into two text fields
    By Grant in forum Access
    Replies: 6
    Last Post: 01-31-2008, 05:52 AM
  4. Text Box Format
    By Scott in forum Forms
    Replies: 0
    Last Post: 01-09-2008, 11:13 PM
  5. Unbound text box truncating text
    By gddrew in forum Forms
    Replies: 0
    Last Post: 03-02-2006, 11:26 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 - Senior Forums