Timer

How about the timer interval limits?
Need call to the Timer control after 10 minutes.

Thanks for help!
DaveHaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

psmith789Commented:
Milliseconds
ten minutes = 1000 x 60 x 10 = 600,000

BUT the maximum allowable value is 65,535 - so you need to set the interval to 60000 (one minute) and use a global or module variable to 'count to 10' before you activate whatever it is you are doing.

Don't forget to initialize and reset the variable!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
Try this instead:

Private Sub Timer1_Timer()
Static dtmInitialTime As Date

    If dtmInitialTime = 0 Then
        dtmInitialTime = Now
    ElseIf DateAdd("n", 10, dtmInitialTime) Then
        MsgBox "10 minutes had elapsed!!!"
        dtmInitialTime = Now
    End If
End Sub
0
psmith789Commented:
I'm not sure that syntax works - how about:  

Private Sub Timer1_Timer()
Static dtmInitialTime As Date

    If dtmInitialTime = 0 Then
        dtmInitialTime = Now
    ElseIf DateDiff(dtmInitialTime, Now, "n") > 10 Then
        MsgBox "10 minutes elapsed!!!"
        dtmInitialTime = Now
    End If
End Sub

- You can set the Interval property to 1000 to check this every second, or higher for less frequent checks.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

JuiletteCommented:
ElseIf DateDiff(dtmInitialTime, Now, "n") > 10 Then

Error on type....
       
0
mark2150Commented:
Set Timer1.Interval = 60000 - one minute

Private Sub Timer1_Timer()
Static Tics as Integer
const factor as integer = 10
Tics = (tics + 1) mod Factor
if tics < 0 then  ... do your 10 minute thing here ...
'
End Sub
0
mark2150Commented:
OOps! should be

If tics < 1 then ...

Sorry.

I just don't know WHY this type of error happens. I have an error correcting modem...

M
0
Éric MoreauSenior .Net ConsultantCommented:
Oups, sorry. A few characters left in somewhere between my head and my fingers!

As other experts had remarked, the correct syntax should be:
Private Sub Timer1_Timer()
Static dtmInitialTime As Date

    If dtmInitialTime = 0 Then
        dtmInitialTime = Now
    ElseIf DateAdd("n", 10, dtmInitialTime) < Now Then
        MsgBox "10 minutes had elapsed!!!"
        dtmInitialTime = Now
    End If
End Sub
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.