Solved

Implementing timers

Posted on 2003-10-29
6
212 Views
Last Modified: 2010-05-03
Hi everyone, I wonder if someone can help/advice/show me how to implement a timer that activate say about 00:00 every night and carry out specific tasks...I am kinda new to vb so noting too complicated..

thanks in advance..


 
0
Comment
Question by:bobgrossett
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
JNSTAUB earned 125 total points
ID: 9642469
timer1 is initialised at 60000 to avoid cpu load

Private Sub Timer1_Timer()

If transerror = True Then Beep
If Now() > transfertdate Then
PROCLABEL.Visible = True
call dosomething
Me.Refresh
Select Case frequency
'may be a daily, a weekly or a monthly activity
Case 0
transfertdate = DateAdd("d", 1, transfertdate)
Case 1
transfertdate = DateAdd("d", 7, transfertdate)
Case 2
transfertdate = DateAdd("m", 1, transfertdate)
End Select
Text4.Text = transfertdate
SaveSetting "WCTRANSFERT", "STARTUP", "NEXTPROC", transfertdate
'set a flag to beep each timer trigger if an errror was detected during the task dosomething
 If dosomething > 0 Then transerror = True
End If

PROCLABEL.Visible = False
End Sub

and other way is to create a service!
0
 
LVL 15

Expert Comment

by:SRigney
ID: 9642510
If you just want something scheduled for midnight and it's running another application you can use Task Scheduler.  
0
 
LVL 4

Expert Comment

by:JNSTAUB
ID: 10163499
my answer was correct .
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question