Try this

vb6 Kuwait
  • 18 years ago

    The timer interval cannot be set to such a high value, so you'll need some help.  Also, the timer is not accurate as to the number of milliseconds.  The timer will be checked in intervals of 55 milliseconds under win98, and every 10 ms for winnt.  So I suggest you use the system time to verify the hour you need.  In the form load, set the interval to 1000 or 1100 milliseconds.  Then use this code in the timer event.

    private sub timer1_timer()

    static start as date

    if (cdbl(start)=0)then
       start=now 'Initialize...This represents a loss of .Interval ms in accuracy
       exit sub
    if ((cdbl(now)-cdbl(start))*24>=1) then
       start=now() 'Reset the starting point

    The above should work ok.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski