how to set timer

if i want to set timer so that i can keep printing part of data every hour n forwarding the page about 2 cm from printer.

how to set the timer for this??

Private Sub cmbPrinters_Click()

mvarPrinterName = cmbPrinters.Text
InitialisePrinter
ExitPacketMode

End Sub

Private Sub Command1_Click()

MoveVertical
End Sub

Private Sub Form_Load()

UpdateCmbPrinters

End Sub

Private Sub UpdateCmbPrinters()
Dim i As Integer

i = 0
For Each X In Printers
cmbPrinters.List(i) = X.DeviceName
i = i + 1
Next
cmbPrinters.ListIndex = 0

End Sub

this the code i have used which moves page on click frm the printer.
[821 byte] By [suvinaik] at [2007-11-20 10:24:55]
# 1 Re: how to set timer
I did something similar a long long time ago ( concerning the time that is )

Add 2 Timers to your form and set both the Timers' Interval property to 6000
By setting it to 6000, it means every minute ( there is 60 seconds in one minute, and each second is 1000 milliseconds )
Create a variable ( of type Integer ) and initialise it to 600 in Form_Load ( This I've named BBack )
Create another Integer variable ( I've named it Current3 )
Create yet another Integer variable and name it Counter
Now create a sub like this :
Public Sub pause3() 'pause function
current3 = Timer
Do While current3 < Timer1.Interval And current3 < .Timer2.Interval
DoEvents
Loop
If current3 >= Timer1.Interval And current3 >= Timer2.Interval Then
counter = counter + 1
BBack = BBack - 1
If counter = 1200 Then
MoveVertical

End If
End If

The prupose of this sub is to do the physical "count down" to estimate if an hour has passed.

In the Timer2's Timer event, write something like this :
Private Sub Timer2_Timer()
pause3
End Sub

That should call the sub that determines how much time is left every minute, then it calls your MoveVertical sub from within pause3.

But if you have any other difficulties, have a look at this (http://www.dev-archive.com/forum/showpost.php?p=1263059&postcount=8) post which includes this as an attachment ( with some other stuff as well - but it should be easy to implement your own logic here )

I hope it helps! :)
HanneSThEGreaT at 2007-11-9 19:35:02 >
# 2 Re: how to set timer
You mean 60,000
jggtz at 2007-11-9 19:36:02 >
# 3 Re: how to set timer
Timers are not very accurate. It's better to keep small increments, and then count them. I usually do 500, to keep track of 1/2 seconds. I display elapsed time this way. The problem is that other events effect the timer.

Timer1.Interval=500
Timer1.Enabled=True

then use a counter.
dglienna at 2007-11-9 19:37:06 >
# 4 Re: how to set timer
There are several ways to overcome the 1 minute max interval of a timer. Here is another one, using a 2 hour target.
When you get ready to set a timer:
Timer1.Tag = DateAdd("h", 2, Now())
Timer1.Interval = 10000 ' 10 second interval or whatever
Timer1.Enabled = True

In the timer's event
If Now() > CDate(Timer1.Tag) Then
Timer1.Enabled = False
call your 2-hour event
End If
LaVolpe at 2007-11-9 19:38:04 >