Hiding a button after 10 seconds

adi32

Registered User.
Local time
Today, 17:08
Joined
Dec 6, 2000
Messages
82
how can i hide a button in a form or make inactive after a certain time
 
Create an Unbound TextBox on your form and call it txtTimer, set its default value to 10. Copy and paste the code below changing "YourButton" to the Name of the button you want to disable.

Code:
Private Sub Form_Open(Cancel As Integer)
    
    Me.txtTimer.SetFocus
    Me.TimerInterval = 1000
    
End Sub

Private Sub Form_timer()
   
   Me.txtTimer = Me.txtTimer - 1

        If Me.txtTimer = 0 Then
            Me.TimerInterval = 0
            Me.YourButton.Enabled = False
        End If

End Sub

HTH
IMO
 
thank you very much
 
The other part is the button's ".Visible" attribute.

You make that "FALSE" to make it invisible.
 

Users who are viewing this thread

Back
Top Bottom