Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to put a running clock on a form 2

Status
Not open for further replies.

ZoDra

Programmer
Oct 27, 2005
36
SI
Hi,

I am quite new in VBA. I designed an application which register coming and leaving of employees. Iz works fine but would look so much better if one would actually see what time it is before registering.

Is there a solution?

Thanks
 
Have a look at the Timer event procedure of the form.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi ZoDra!

[ol][li]Put a label on your form.[/li]
[li]Name it lblClock.[/li]
[li]Type [!]The current time is[/!] as its caption.[/li]
[li]Create the following procedure:[/li][/ol]
Code:
Private Sub Form_Timer()
    Me.lblClock.Caption = "The current time is " & Format(Now(), "hh:mm:ss")
End Sub

Hope this helps.

Tom

Born once die twice; born twice die once.
 
Thank you both PHV and TomasLafferty. Sorry didn't mean to be rude, just my english is somehow rusty (long time no conversation).

Regards from Ljubljana, Slovenia.
 
ZoDra - you are welcome and thank you for the star! Incidentally, I did not think you were rude at all. [smile]

Thanks again.

Tom

Born once die twice; born twice die once.
 
Thanks Tom, but take a look at two FAQ links in PHV post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top