Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Location
    Japan
    Posts
    14

    Post Unanswered: Control Blinking Text

    Ok here is my question:

    I have a form that has a Due Date field. When this the date is 7 days before the date in the box the Labl with the text box begins blinking. Thats works like I want it to.
    Now when a user views the record and places a Check in the Verified check box I want the lable for the Due Date to stop blinking.

    The Code for the Blinking to start is here.

    Code Start ---------------.

    Private Sub Form_Timer()
    If Me.DueDate > Now() - 8 Then
    With blinkingLabel
    .ForeColor = (IIf(.ForeColor = -2147483640, 255, -2147483640))
    End With
    End If
    End Sub

    Code End ----------------

    This is the Code that I am working on.
    My thought was to say if the there is a check n the verified change the TimerInterval to 0 and the colore to black. But the blinking does not stop.


    Code Start------------------

    Private Sub Form_Current()
    If Me.Verified = True Then
    Me.TimerInterval = 0
    Me.blinkingLabel.ForeColor = vbBlack
    End If
    End Sub

    Code End ---------------

    What am I missing?

    Thanks in Advanced
    Tommy
    Grafik Interfaces
    www.grafiksinc.com

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    As noted elsewhere:

    The current event fires when the form loads and when the user changes records. It will not fire when the user checks the box. You could put that code to set the timer interval in the after update event of the checkbox, or change your code to:

    If Me.DueDate > Now() - 8 AND Me.Verified = False Then
    Paul

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You may also need a me.repaint command to repaint the screen.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2009
    Location
    Japan
    Posts
    14

    Thumbs up

    Guys,

    Thanks for the ideas.

    Here is what I ended up doing:

    To make the Text blink Red and Black 7 days before the due date I use this Code:

    Code Start------
    If Now() > Me.DueDate - 8 Then
    With blinkingLabel
    .ForeColor = (IIf(.ForeColor = -2147483640, 255, -2147483640))
    End With
    End If
    End Sub

    Code End--------

    I decided to use a button rather than a check and the code on the Verfiy button is:

    Code Start------

    Me.DueDate = Me.DueDate.Value + 90
    Me.blinkingLabel.ForeColor = vbBlack

    Code End------

    When the button is pressed the date is changed in this case 3 mos in the future. A requirement set forth by the user. and the text set to Black to stop it from blinking.

    So this is doing what I needed it to do.

    What you guys said got me thinking a little harder.
    Tommy
    Grafik Interfaces
    www.grafiksinc.com

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Look into the me.repaint command. This 'repaints' the current form with new data.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    May 2006
    Posts
    386
    Hi, I have a similar required and I would appreciate some advice. What I have is as follows:

    I have several Check Boxes in my Form which keep updating as soon as I click on on an Employee from my Employee drop down box. What I want is this:

    IF a Check box (i have several of them) is False THEN the label text and background should start Blinking in Red

    And if a Check box is TRUE THEN it should stay as normal Black text.

    Since I am not that good with coding, i would appreciate if the above code could be amended to meet my requirements please.
    Emi-UK
    Love begets Love, Help Begets Help

Posting Permissions

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