continuously update the time in access form control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The form control displays date and time. But the time stays static as at when
the user first enters the form. How can it be continuously updated - to show
the time 'ticking'?
 
access said:
The form control displays date and time. But the time stays static as at when
the user first enters the form. How can it be continuously updated - to show
the time 'ticking'?
Use the form timer event, in the case that it is really necessary to
display the time 'ticking'.


mfG
--> stefan <--
 
Thanks Stefan - I'll give it a try.

Stefan Hoffmann said:
Use the form timer event, in the case that it is really necessary to
display the time 'ticking'.


mfG
--> stefan <--
 
Stefan - I have a problem that the hourglass cursor flashes every second now
in line with the requery at the timed interval. Any ideas on this? thanks
 
hi,

access said:
Stefan - I have a problem that the hourglass cursor flashes every second now
in line with the requery at the timed interval. Any ideas on this? thanks
No, this is the normal case as your form is new painted.

mfG
--> stefan <--
 
I had this issue last week and did the following to fix it:

Set the forms timer interval property to 100

Wrote the following code for the "on timer" event of the form:
"Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub"

By doing it this way you do not have to requery.
Hope this Helped.

James D.
 
Hi James - thanks for that I'll give it a try.


James D. said:
I had this issue last week and did the following to fix it:

Set the forms timer interval property to 100

Wrote the following code for the "on timer" event of the form:
"Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub"

By doing it this way you do not have to requery.
Hope this Helped.

James D.
 
Just a note for myself (and other users who may pick this up) - the txt box
which displays the time MUST be unbound for this to work. Otherwise it will
give error "run-time error '2448' you can't assign a value to this object"
 
Back
Top