Results 1 to 3 of 3

Thread: Clock on Form

  1. #1
    Join Date
    Jan 2004

    Unanswered: Clock on Form

    Does any one know how i can have alive counting clock on my form?


  2. #2
    Join Date
    Nov 2003

    Clock on a form

    To put a simple text clock on a form, create a Label called lblClock on the form, set the form's TimerInterval to 1000, and the following code behind the Timer Event.
    You can also create two command buttons called cmdClockStart and cmdClockEnd and attach respective code to each to have the clock run on demand.
    '***************** Code Start ***************
    Private Sub Form_Timer()
    Me!lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
    End Sub

    Private Sub cmdClockStart_Click()
    Me.TimerInterval = 1000
    End Sub

    Private Sub cmdClockEnd_Click()
    Me.TimerInterval = 0
    End Sub
    '***************** Code End ***************

  3. #3
    Join Date
    Oct 2003
    Provided Answers: 1
    Here is a sample showing you how to use the Form Timer to simulate an O'clock
    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