Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2017
    Posts
    2
    Provided Answers: 1

    Answered: Forecolor backcolor settings only show when control gets the focus

    I have 25 UNBOUND CONTROLS ON MY MAIN FORM

    Once the dates are st in the applicable controls I the evaluate the date to set the background to yellow if it meets the criteria.

    I have run the code from the Current event, open event , activate event, and even used conditional formatting

    If Me.tDate1 >= Date - 2 And Me.tDate1 <= Date And IsNull(Me.aDate1) Then
    Me.tDate1.BackColor = vbYellow
    Me.tDate1.ForeColor = vbBlack
    Me.Repaint
    End If

    If Me.tDate2 >= Date - 2 And Me.tDate2 <= Date And IsNull(Me.aDate2) Then
    Me.tDate2.BackColor = vbYellow
    Me.tDate2.ForeColor = vbBlack
    Me.Repaint
    End If

    The problem is that the code works as designed (I have stepped through it to return the values ) but the controls will not show the yellow backcolor until they get the focus and then the yellow goes away when the control loses the focus

    I have tried repaint, refresh etc.

    I know this should be working as designed but its not

    btw I have been a member for years but lately my old user ID (axsprog) does not show my posts and I cannot get anyone to address it

    Any help with this post would be greatly appreciated

  2. Best Answer
    Posted by djones1

    "the back style was set to transparent"


  3. #2
    Join Date
    Jul 2017
    Posts
    2
    Provided Answers: 1

    resolved

    the back style was set to transparent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •