Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2004, 09:45 PM
Registered User
 
Join Date: May 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mjwelker
Default Displaying Continuous Time (Clock)

I'm trying how to display the time so the seconds keep showing and the time changing.

Thanks

 
Old May 4th, 2004, 05:06 AM
Authorized User
 
Join Date: Jun 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I use a timer to make this work
Set timer interval to 500 and enable it in the form load event

Private Sub Timer1_Timer()
Me.Caption = Format(Date, "Long Date") & " " & Format(Time(), "Long Time")
End Sub

Dunnie
 
Old August 17th, 2004, 06:56 AM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dunie

i have just happened to search for my problem about how to display a clock on the Main menu in MS Access and come across this post.

Would you mind showing me more specifically how to do that? Where to set the interval and etc..

Many thanks:)

 
Old February 5th, 2009, 01:53 PM
Authorized User
 
Join Date: Mar 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Clock on a Form

Create a text box on a form and call it txtClock
Set the format to Long Time

Go to the properties for the for and set the timer to 1000

use Code builder to set an event procedure under "On Timer"

Code should look like this:


Private Sub Form_Timer()

Me.txtClock.Requery
End Sub
 
Old April 8th, 2009, 05:15 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by dunnie View Post
I use a timer to make this work
Set timer interval to 500 and enable it in the form load event

Private Sub Timer1_Timer()
Me.Caption = Format(Date, "Long Date") & " " & Format(Time(), "Long Time")
End Sub

Dunnie
I would say that 500mS is a little slow. The update would only take place every ½ second.

When I do this, I always make the update 1/10 of a second or less. It just makes for a smoother-running clock...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying a clock hdfireftr Visual Basic 2005 Basics 2 September 15th, 2006 01:12 PM
How To Calculate Monthy Total on-the-clock time Michaniker Access 2 December 2nd, 2005 06:06 PM
Error - Not Displaying time jzycn2 ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2005 01:32 PM
Alarm Clock/How to Compare Set TIme mjwelker VB How-To 2 May 5th, 2004 05:04 AM
Display Continuous Time mjwelker VB.NET 2002/2003 Basics 1 May 4th, 2004 08:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.