Results 1 to 4 of 4

Thread: Timer event problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    2

    Exclamation

    Hi,

    I am having a crazy problem in VB 5.0. I have a timer in a form where the interval is set to 60000. But for some reason the timer event for the control is not firing. This is happening at random. What could be the reason or what should I do to avoid this problem? This is very urgent.

    Thanks

    Paul

  2. #2
    Junior Member
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    22
    Are you waiting long enough to check if it is firing? 60000=roughly 1 min

  3. #3
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    Is there code in your app that is setting the enabled property of the Timer to false, and then not setting it back to true as needed?

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    The timer control doesnt handle things around 60,000 very well.
    Keep the interval low, it will also make it more accurate.
    Also try code like this :

    Code:
    Option Explicit
    Dim elapsed As Long
    
    Private Sub Form_Load()
        Timer1.Interval = 1000
        Timer1.Enabled = True
    End Sub
    
    Private Sub Timer1_Timer()
        elapsed = elapsed + 1
        If (elapsed = 60) Then
            elapsed = 0
            MsgBox "siajdaoi"
        End If
    End Sub
    Let me know if that works.
    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width