how to create a flashing label?

bacardi451

Registered User.
Local time
Today, 18:51
Joined
Mar 20, 2002
Messages
33
Hi,
I need advice on is there a way to make a label flash on a form. I would like it to flash every 5 seconds.

Thanks in advance
Al
 
I have tried this code but I cant figure it out. I have a Label on the main form that needs to flash when the form is open.
I have tried to lookig at other post and searched the web and could not get any other information on this.

Thank You
Al
 
Place the following code in the "On Timer" event of your form.

If Me.LabelName.ForeColor = vbBlack Then
Me.LabelName.ForeColor = vbRed
Else
Me.LabelName.ForeColor = vbBlack
End If


Then enter a value in the "Timer Interval" for the form. This figure will relate in milliseconds to the rate of the On Timer event. (eg: 1000 = 1 sec; 500 = 0.5 sec)

This will result in the label flashing black & red.

If you wish to have the label appear and then disappear, simply alter the "On timer" code to:

Private Sub Form_Timer()
If Me.LabelName.Visible = True Then
Me.LabelName.Visible = False
Else
Me.LabelName.Visible = True
End If
End Sub

HTH

Brad.
 
Wow, resurrected a thread from 2002 to put your code in.
I know you don't mean any harm T.DURAI but these forums are for asking for help and giving help where asked for - not for showing off (and the code isn't very good or useful code anyway I'm afraid to say). If you want to show off your programming post it as samples in the Code Repository
 
#8 This morning there was a nut (i think from India also, judging by the name, that posted a whole bunch of undescribed .MDBs). The "contributions" were deleted. I wonder if it is the same one.
 
Place the following code in the "On Timer" event of your form.

If Me.LabelName.ForeColor = vbBlack Then
Me.LabelName.ForeColor = vbRed
Else
Me.LabelName.ForeColor = vbBlack
End If


Then enter a value in the "Timer Interval" for the form. This figure will relate in milliseconds to the rate of the On Timer event. (eg: 1000 = 1 sec; 500 = 0.5 sec)

This will result in the label flashing black & red.

If you wish to have the label appear and then disappear, simply alter the "On timer" code to:

Private Sub Form_Timer()
If Me.LabelName.Visible = True Then
Me.LabelName.Visible = False
Else
Me.LabelName.Visible = True
End If
End Sub

HTH

Brad.

Thanks, just used it to flash my wife a reminder on a form . Not sure she will Appreciate. it.:)
 
Is it possible to disable the following code with a cmd Button?

Code:
 Private Sub Form_Timer()
  If Me.lblF9F10.ForeColor = vbBlack Then
  Me.lblF9F10.ForeColor = vbBlue
  Me.lblF9F10.BackColor = vbYellow
  Else
  Me.lblF9F10.ForeColor = vbBlack
  Me.lblF9F10.BackColor = vbRed
  End If
  End Sub
 
I found the answer> Hope this help someone else.
Code:
Private Sub cmdStopFlash_Click()
Me.TimerInterval = 0
End Sub
.
 

Users who are viewing this thread

Back
Top Bottom