Results 1 to 3 of 3
  1. #1
    jlindquist23 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2019
    Posts
    21

    Border Color Formatting in a Report

    I'm attempting to turn a border color to red based on certain criteria:



    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.UDF_PK_SWK_YESNO.Value = "Y" Then
    ItemCode.BorderColor = vbRed
    ItemCodeDesc.BorderColor = vbRed
    End If
    End Sub


    When I use this in the On Format section of the Detail part of my report, it colors the borders of every line item for ItemCode and ItemCodeDesc red.
    Can you tell me what I'm missing? I've tried all different kinds of combinations.

    IClick image for larger version. 

Name:	Capture.JPG 
Views:	10 
Size:	60.1 KB 
ID:	41825 added a picture. Only the ones circled should have borders.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    8,282
    you never turned red off:
    Code:
    If Me.UDF_PK_SWK_YESNO.Value = "Y" Then
      ItemCode.BorderColor = vbRed
      ItemCodeDesc.BorderColor = vbRed
    else
      ItemCode.BorderColor = vbBlack
      ItemCodeDesc.BorderColor = vbBlack
    End If
    but I use ON PRINT.

  3. #3
    jlindquist23 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2019
    Posts
    21
    Oh geez... rookie mistake. Thanks!

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

Similar Threads

  1. Object Control doesn't contain border color
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 11-25-2014, 05:02 PM
  2. Replies: 2
    Last Post: 11-06-2013, 02:12 PM
  3. Report Back Color formatting
    By RayMilhon in forum Reports
    Replies: 5
    Last Post: 02-07-2012, 03:20 PM
  4. Conditional Formatting date due color
    By Desstro in forum Programming
    Replies: 1
    Last Post: 12-08-2010, 11:12 PM
  5. Replies: 0
    Last Post: 11-13-2009, 10:18 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