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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time

Status
Not open for further replies.

dstrat6

Programmer
Mar 24, 2008
29
US
Hi everyone, I need to be pointed in the right direction on how to configure a label to read the current time(Now) but continuously. I have it working with Selection Change but really would like it to update itself with out doing anything.

Any pointers would be great!

Regards,
Dstrat
 
Code:
Private Sub Form_Load()
    Label1.Caption = Format(Now, "dddd, mmmm dd, yyyy hh:nn:ss AMPM")
    Me.TimerInterval = 500
End Sub

Private Sub Form_Timer()
    Label1.Caption = Format(Now, "dddd, mmmm dd, yyyy hh:nn:ss AMPM")
End Sub
 
Hellow Golom,

VBA Excel 2000 doesn't allow me to implement Me.TimerInterval, Is there a certain Reference that has to be checked off. I also see that you you were calling a form. Does this have to be done with a form or can it also be used with a Worksheet?

Regards,
Dstrat
 
dstrat6,
[tt]TimerInterval[/tt] is Microsoft Access, it does not have a built in counterpart for Excel (MSForms 2.0) and there is no TIMER control like VB6 that I'm aware of.

Try searching for the SetTimer/KillTimer API functions.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 




Also check out the Timer Function.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
To All,

Thanks everyone for your tips. It took some time but I finally got it. I appreciate the fact that you make people figure it out on there own and make them think a little. Sometimes it takes a little hint to get the brain working in the right direction.

Best Regards,
Dstrat6
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top