Using a timer to display a text box

  • Does anyone no a better way

     

    If Now > ([1st Treatment Date] + 105) Then

    Start = Timer

    Do While Timer < Start + 15

    RedFlag1.Visible = True

    DoEvents

    Loop

    RedFlag1.Visible = False

    Else

    RedFlag1.Visible = False

    End If

  • Your way looks pretty OK to me. Slight change for you.

    RedFlag1.Visible = False ' set to false at beginning

    If Now > ([1st Treatment Date] + 105) Then

    Start = Timer

    Do While Timer < Start + 15

    If RedFlag1.Visible = False Then

    RedFlag1.Visible = True

    End If

    DoEvents

    Loop

    RedFlag1.Visible = False

    End If


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Alternatively.

    Paste this into general dec section

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    RedFlag1.Visible = False ' set to false at beginning

    If Now > ([1st Treatment Date] + 105) Then

    RedFlag1.Visible = True

    Sleep 15

    End If

    RedFlag1.Visible = False


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply