Solved

Implementing timers

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Window placement 17 74
vb6 connector to SQL Server 2 34
How to compare ms sql hashbytes results within vb6 5 51
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 45
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

919 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

15 Experts available now in Live!

Get 1:1 Help Now