Label blink/flash once or twice only?

BarryMK

4 strings are enough
Local time
Today, 10:34
Joined
Oct 15, 2002
Messages
1,350
I'd like to use the OnTimer event to make a control label blink a couple of times and then remain static and visible. Normally the code below would run a piece ofcode once only after loading the form but the blink code doesn't work inside this Ontimer event as it stands. Any ideas?

Code:
‘Put:
Dim t as long
‘in the declarations section at the top of your form.


‘In the On Load event, put: 
t = 0

‘In the On Timer event put:
If t = 0 then
'Your code here
	 Me!lblProbDesc.Visible = Not (lblProbDesc.Visible)
t = 1
End If
 
possible? play with 'if t=5' adjusting the number up or down (and the TimerInterval for faster or slower blinking). hth.
Code:
Option Compare Database
Option Explicit
Dim t As Long

Private Sub Form_Load()
    t = 0
    Me.TimerInterval = 1000
End Sub

Private Sub Form_Timer()

    Me!lblProbDesc.Visible = Not (lblProbDesc.Visible)
    t = t + 1
    If t = 5 Then
        Me!lblProbDesc.Visible = True
        Me.TimerInterval = 0
    End If
    
End Sub
 
Last edited:
Thanks Wazz

I actually tried just changing 1 to 5 without success so I'll try your code.
 
Works perfectly thanks very much! :)
 

Users who are viewing this thread

Back
Top Bottom