Marshall Barton replied to naveen prasad
28-Jan-10 06:54 PM
Do you really need to do that? The Windows task bar has a
decent clock going all the time.
If you have to have your own clock on your form, you need to
put the code in the form's Timer event with the
TimerInterval property set to the number of milliseconds
between updating the text box.
BTW, your old VB is showing ;-)
The Text property in Access is NOT used to set a text box's
value. Instead, use the Value property, which is the
default property so you do not even need to specify it. The
timer event code would simply be:
text1 = now()
BUT, there are consequences to using a timer event and in
general you should avoid using it. The primary consquence
is that you can not edit a VBA module while a timer is
running. The VBA editor thinks it is in charge of
keystrokes and suddenly your form gets control so the
keystrokes are going to the wrong place.
--
Marsh
MVP [MS Access]