?
Solved

Implementing timers

Posted on 2003-10-29
6
Medium Priority
?
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
JNSTAUB earned 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

770 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