Results 1 to 9 of 9

Thread: Multiple Timers Again?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    7

    Unhappy Multiple Timers Again?

    hee hee heeee....
    Well I haven't found this problem on the forum yet...
    I start my app with form1 which has Timer1 & Timer2 both disabled.
    After doing an email inbox login with a click...it exits starting Timer1.
    So Timer1 code starts running which has Timer2.Enable = True but Timer2 never starts...Whats up with that?
    Thanks

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Multiple Timers Again?

    Does Timer2 have any Interval?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    7

    Re: Multiple Timers Again?

    Yes...I have Timer1 @ 2000 & Timer2 @ 500..

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Multiple Timers Again?

    So what code do you have in the timers? I can only think of a mistake with code logic, but there are so many ways to go wrong that it is hard to go guessing.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    7

    Re: Multiple Timers Again?

    Private Sub Command1_Click()
    Dim boolRetVal As Boolean, objdelaymins As Integer
    boolRetVal = True
    'objSession.CurrentUser
    If boolRetVal = True Then
    Text2 = "Logged ON"
    Timer1.Enabled = True
    Timer1.Interval = 20000
    Else
    End If
    End Sub 'Command1_Click()
    *******************************
    Private Sub Timer2_Timer()
    newTime = Time
    MsgBox "New time" & newTime
    End Sub
    *********************************
    Private Sub Snd_Err_Email()
    MsgBox "The error message has been sent!"
    ErrSentSw = 1
    Timer2.Interval = 500
    Timer2.Enabled = True
    End Sub 'Snd_Err_Email()
    ***********************************************
    Private Sub Timer1_Timer()
    objMsgCnt = 1
    objMsgCntMax = 1
    objMsgCnt = objMsgCnt + 1
    If objMsgCnt >= objMsgCntMax Then
    If ErrSentSw = False Then
    Call Snd_Err_Email 'Send an error message to the list
    End If
    Else
    'objMsg.Delete
    End If
    End Sub 'Timer1_Timer()

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    7

    Re: Multiple Timers Again?

    I've chopped most of the code out but this still won't run the Timer2 sub.
    You can see that Timer1 starts a sub which sends an error email message and also then starts Timer2.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    7

    Re: Multiple Timers Again?

    Damn...It just worked for me...guess I've gotta start adding stuff back a piece at a time...
    Thanks for your time!

  8. #8
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Multiple Timers Again?

    You should not need two timers on a form anyway...

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Multiple Timers Again?

    View help with timers in my signature...

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