Results 1 to 4 of 4

Thread: Counting down, how?

  1. #1

    Thread Starter
    Hyperactive Member Libero's Avatar
    Join Date
    Jun 2000
    Location
    Swedish viking
    Posts
    460

    Unhappy

    i got a value as for example 01:34:32 (hh:mm:ss). Wich is the best and easiest way to count down this to 00:00:00,
    and then put my code. i want to display the time in a label.

  2. #2
    Lively Member Kersey's Avatar
    Join Date
    Jun 1999
    Location
    The Netherlands
    Posts
    101

    countdown

    just count up and use dateadd/datediff :

    Dim x As Date
    Dim y As Date

    Private Sub command1_click()
    x = Now()
    Debug.Print TimeSerial(0, 0, DateDiff("s", y, x))
    End Sub

    Private Sub Form_Load()
    y = DateAdd("h", 1, Now())
    End Sub


  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Code:
    Dim tTime As Date
    
    Private Sub Form_Load()
        
        Timer1.Interval = 1000
        tTime = Now
        
    End Sub
    
    Private Sub Timer1_Timer()
        tTime = DateAdd("s", -1, tTime)
        Label1.Caption = Format(tTime, "hh:mm:ss")
    End Sub
    Iain, thats with an i by the way!

  4. #4

    Thread Starter
    Hyperactive Member Libero's Avatar
    Join Date
    Jun 2000
    Location
    Swedish viking
    Posts
    460

    Talking

    Thanks both!!!! It worked well. me.so glad.

Posting Permissions

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



Click Here to Expand Forum to Full Width