Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best event or method to make a label invisible after a short time?

Status
Not open for further replies.

BFP

Technical User
May 18, 2000
52
0
0
US
Hi All.

I am trying to implement a status label that appears when a filter is applied that returns 0 records. Now I seem to have no problem getting the label to become visible, but making it invisible again is an issue.

Here is my code to make it visible/invisible, which is run on a button click event.

Code:
Private Sub checkStatus()
    If Me.CurrentRecord = 0 Then
        RunCommand (acCmdRemoveFilterSort)
        lblStatus.Visible = True
    Else
        lblStatus.Visible = False
    End If
End Sub

So my question is: what is the generally accepted best event to turn a status label off such that it has been visible for at least a few seconds?

For the heck of it, I tried to use the form's MouseMove event, but it never seems to fire (just the opposite of what I would think).

Should I set up a timer? If so, how? In either case, I would like to know if there are non-standard event listeners out there?

Thanks in advanced.

BFP
 
That did it...thanks.

Here is the implementation:

Code:
Private Sub Form_Timer()
    With Me.lblStatus
        .Visible = False
    End With
End Sub

Private Sub checkStatus(recordCount)
    If Me.CurrentRecord = 0 Then
        ...
        lblStatus.Visible = True
        Me.TimerInterval = 5000

    Else
        Me.TimerInterval = 0
        lblStatus.Visible = False
        ...
    End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top