(Q) How do I make a label flash?
(A) You have to use the form's Timer event for this.
For example, let's say you have a label called
"lblSomeLabel" on a form. Also on the same form you have an embedded
subform, the relationship being 1:M.
Now let's say you want to alert the user by flashing the caption if
more than 3 records exist on the subform for each record on the parent form.
So, place the following code behind the Timer event.
Private Sub Form_Timer()
With Me.lblSomeLabel
.ForeColor = (IIf(.ForeColor = vbRed, vbBlack, vbRed))
End With
End Sub
Now all you need is some code in the main form that triggers the
Timer. Place this code behind the main form's OnCurrent event.
Private Sub Form_Current()
If Me![SomeSubForm].Form.RecordsetClone.RecordCount > 3 Then
Me.TimerInterval = 300
Else
Me.TimerInterval = 0
Me.lblSomeLabel.ForeColor = vbBlack
End If
End Sub
|