Unload Me

How do I make a form unload by itself in like 2 minutes? I think you have to use a timer, but I am not sure. Please help. Thanxs!


Comments

  • : How do I make a form unload by itself in like 2 minutes? I think you have to use a timer, but I am not sure. Please help. Thanxs!


    Hi Matt,

    You are right about the timer. The only thing is, a timer has a limit of 1 minute.

    so you either have to use two timers with the second one disabled, and use the first one to enable the second one, or create a routine like I did hear, but in both cases, you would not be able to go over two minutes.

    If you want to go over two minutes, then you would have to do something different like maybe more than two timers.


    Here is an example a how to do it using a public variable:


    Public UnloadValue As Boolean


    Private Sub Timer1_Timer()

    If UnloadValue = False Then

    UnloadValue = True

    Exit Sub

    End If

    Unload Me


    End Sub




  • Here's one:


    Set the timer interval to 60000


    Sub Timer1_Timer()


    Static TimerCount As Integer

    TimerCount = TimerCount + 1

    If TimerCount = 5 Then Unload Me


    End Sub


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories