timing a module 
Author Message
 timing a module

Hi there, i need to call a module every 15 mins, but i
dont want to use the ontimer event as i am using this to
drive a clock on the form, can anybody advise me of how to
do this.  I have tried various ways, but it seems to
constantly call.

Many thanks

Nath.



Fri, 11 Mar 2005 22:30:54 GMT  
 timing a module
Well, you could use the same timer with a static variable in it and increment
the variable every time you call the timer event and then when it reaches some
number reset the variable to zero, and execute your module.  

UNTESTED CODE follows

Private Sub Form_Timer()
Static lngExecCount As Long

   'set the clock (assume once a second)

   lngExecCount = lngExecCount + 1

   'If more than 15 * 60 = 900 seconds have passed
   'If timer event is not 1000 (every second)
   'then adjust the cutoff number higher or lower
   If lngExecCount > 900 Then
      lngExecCount = 0
      'execute your function/procedure
   End If

End Sub

Quote:

> Hi there, i need to call a module every 15 mins, but i
> dont want to use the ontimer event as i am using this to
> drive a clock on the form, can anybody advise me of how to
> do this.  I have tried various ways, but it seems to
> constantly call.

> Many thanks

> Nath.



Fri, 11 Mar 2005 22:55:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Modules, Modules, Modules

2. Help with one time module

3. Module running multiple times

4. Compiling/Saving Modules with A97 Run-Time

5. Custom run time module with overlays

6. Run Time Module

7. Question about run-time module distributation license

8. Users Profiles and VB5 Run-time module

9. VBA Module to Module

10. Circular Reference Between Modules when 2 Class Modules Listen to Each others Events

11. Referece a module and have it not run the module

12. Edit / change module witin module

 

 
Powered by phpBB® Forum Software