MSGBox win conditional Formatting is True

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DJRhino1175
    New Member
    • Aug 2017
    • 221

    MSGBox win conditional Formatting is True

    I have conditional formatting in a textbox based on a value of another textbox.

    Code:
    [Actual]>[Est Target]
    When this code is true in turns the font Bold and Red of the txt box [Actual]

    What I need help with is how do I trigger a msgbox based of this conditional formatting? Or would it be better to do an after update code that does the conditional formatting and trigger the msgbox?
  • isladogs
    Recognized Expert Moderator Contributor
    • Jul 2007
    • 479

    #2
    Hi
    Apologies for the long delay in responding but there was an issue preventing anyone responding until now.
    Have you fixed your problem in the meantime, or do you still need help?

    Comment

    • DJRhino1175
      New Member
      • Aug 2017
      • 221

      #3
      Isla,

      No I have not been able to fix this issue as of yet. I still need help.

      Comment

      • isladogs
        Recognized Expert Moderator Contributor
        • Jul 2007
        • 479

        #4
        You could indeed use the AfterUpdate event to do both of these. For example:
        Code:
        Private Sub Actual_AfterUpdate()
            With Me.Actual
                If Me.Actual > Me.Est_Target Then
                    .ForeColor = vbRed
                    .FontWeight = 700 'bold
                    MsgBox "Actual>Ext_Target", vbInformation, "Message Title"
                Else
                   .ForeColor = vbBlack
                   .FontWeight = 400 'normal
                End If
            End With
        End Sub
        Adjust as appropriate

        Comment

        • DJRhino1175
          New Member
          • Aug 2017
          • 221

          #5
          Isla,

          Thanks for the assist. I will give it a shot. It worked like a charm.

          Thanks

          Comment

          • isladogs
            Recognized Expert Moderator Contributor
            • Jul 2007
            • 479

            #6
            Glad I could help. Good luck with your project

            Comment

            Working...