Results 1 to 4 of 4

Thread: timer

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    timer

    im trying to use a timer that executes code every 10 mins but it isnt working it keeps saying invalid property type when i enter 600,000 in the interval is there anyway to make it work? or anyway to do it a diffrent way?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: timer

    From the help file:

    "The interval can be between 0 and 64,767, inclusive, which means that even the longest interval can't be much longer than one minute (about 64.8 seconds)."

    Set a timer for 1 minute and count the number of times it fires. when it's fired 10 times, 10 minutes have elapsed.

  3. #3
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: timer

    the timer as a limit of just over a minute so you could set the timer to 60,000(1 minute) and keep track of how many times it fires
    VB Code:
    1. Option Explicit
    2. Private counter As Integer
    3. '-------------------------------------
    4.  
    5. Private Sub Timer1_Timer()
    6.  counter = counter + 1
    7.  
    8.   If counter = 10 Then
    9.    'code here, 10 minutes as passed
    10.    counter = 0 'reset the counter
    11.   End If
    12.  
    13. End Sub

    casey.

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    Re: timer

    Quote Originally Posted by vbasicgirl
    the timer as a limit of just over a minute so you could set the timer to 60,000(1 minute) and keep track of how many times it fires
    VB Code:
    1. Option Explicit
    2. Private counter As Integer
    3. '-------------------------------------
    4.  
    5. Private Sub Timer1_Timer()
    6.  counter = counter + 1
    7.  
    8.   If counter = 10 Then
    9.    'code here, 10 minutes as passed
    10.    counter = 0 'reset the counter
    11.   End If
    12.  
    13. End Sub

    casey.
    i will try that thanks :-)

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