Solved

Implementing timers

Posted on 2003-10-29
6
208 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now