So I need to display a real-time clock on my form but I am not sure how. I do know that the code:
TimeValue(Now)
will give me the current time, but I am not sure how to continually display this on my form.
I have an idea which is to put this code inside of a loop as follows:
Dim bool As Boolean
bool = True
Do While bool = True
Label1.Caption = TimeValue(Now)
Loop
However I am not sure where to put this code. Any suggestions would be greatly appreciated!
I solved the issue others were having with the given code in the chosen answer. I removed the
latesttimeline and i changedLabel1.caption = Now()to useTime()instead.I then called this in my
userform_initializefunction.Label1.captionwas changed to the appropriate label on myuserform.