Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Posts
    68

    Unanswered: Getting Time From Local Machine??

    Please Help!

    I have a problem, i need to be able to have the time running live, (with counting seconds) but i dont know how to do it. I want to insert in form design, can anybody help? I have heard of a way of runnin it from the local machine, but im not exactly sure how to do it.

    Can any body help?

  2. #2
    Join Date
    Dec 2002
    Posts
    117

    Re: Getting Time From Local Machine??

    It is easy. All you have to do is insert a textbox on the form wherever you want to display the time and make the textbox control source be this =Time()

    Thats all you have to do. Hope this helps.



    Originally posted by 00304367
    Please Help!

    I have a problem, i need to be able to have the time running live, (with counting seconds) but i dont know how to do it. I want to insert in form design, can anybody help? I have heard of a way of runnin it from the local machine, but im not exactly sure how to do it.

    Can any body help?

  3. #3
    Join Date
    Dec 2002
    Posts
    117

    Live Time

    I just noticed you want the time to run live. I am not sure as to how to accomplish this, but I do know the way I stated above will show you the correct time each time the report is opened.

  4. #4
    Join Date
    Jan 2004
    Posts
    68

    Re: Getting Time From Local Machine??

    thanks for the post, but i already no how to do that, i need something that will update the time in seconds live, time() only gives the from when you opened the form

    Thanks anyway

  5. #5
    Join Date
    Jan 2004
    Location
    Norwich UK
    Posts
    20
    There is a way you can have a self-updating clock... it's in a thread somewhere as I saw it only the other day.. I'll post it if i find it

  6. #6
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Use the "On Timer" and "Timer Interval" events.

    Set the "Timer Interval" to 1000. This is given in milliseconds, so an interval of 1000 will be every second.

    Set the "On Timer" to an event procedure. In the procedure, set the control on the form to time().

    So, for example, if your time control was named "txtTime" then your timer event procedure would look like this:
    Code:
    Private Sub Form_Timer()
       txtTime = Time()
    End Sub

  7. #7
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41
    If you need a more accurate timer and your app can handle a higher refresh rate, set the TimerInterval to 250 or 300, since the Timer event may not fire at exactly 1000 milliseconds. If the Timer fires a bit late, you could end up with almost two seconds between an update of the "seconds" in your counter.

    Not sure if that helps or not.

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Here is a nice example to see how the timer works
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •