I used =now() in a text box and that nicely displays date and time at
the moment of opening
How would I show updated data?
I thought of an event procedure, but which one would I use since there
really isn't any data choosing or mouse event associated with the
date/time update
Jerry
paii, Ron - 12 Jan 2006 16:00 GMT
Try the "On Timer" event.
> I used =now() in a text box and that nicely displays date and time at
> the moment of opening
[quoted text clipped - 6 lines]
>
> Jerry
jerry.ranch@pioneer.com - 12 Jan 2006 16:22 GMT
what object is on timer associated with
I don't see it in my event procedures for a text box
(VBA newbie)
Jerry
>Try the "On Timer" event.
paii, Ron - 12 Jan 2006 17:19 GMT
It is a Form event.
> what object is on timer associated with
> I don't see it in my event procedures for a text box
[quoted text clipped - 3 lines]
>
> >Try the "On Timer" event.
Anthony England - 12 Jan 2006 16:03 GMT
>I used =now() in a text box and that nicely displays date and time at
> the moment of opening
[quoted text clipped - 6 lines]
>
> Jerry
You want to show a 'working clock' on your form which just displays the
current time and is not bound to any data? You could use the form's Timer
event and update every minute, second or whatever.
Or are you talking about showing the date and time a record was created or
amended?
jerry.ranch@pioneer.com - 12 Jan 2006 16:19 GMT
Just current date and time
>Or are you talking about showing the date and time a record was created or
>amended?
Anthony England - 12 Jan 2006 16:33 GMT
> Just current date and time
>>
>>Or are you talking about showing the date and time a record was created or
>>amended?
Go to the properties of the form
set the Timer Interval to 1000 (this is milliseconds)
go to the On Timer and event and just write something like:
Me.txtTime = Format(Now(), "hh:nn:ss")
jerry.ranch@pioneer.com - 12 Jan 2006 16:57 GMT
works famously
I was looking in the properties of the txt box and could't find timer
there
Thanks all
Jerry
>Go to the properties of the form
>set the Timer Interval to 1000 (this is milliseconds)
>go to the On Timer and event and just write something like:
>Me.txtTime = Format(Now(), "hh:nn:ss")
Beowulf - 12 Jan 2006 16:05 GMT
> I used =now() in a text box and that nicely displays date and time at
> the moment of opening
[quoted text clipped - 4 lines]
> really isn't any data choosing or mouse event associated with the
> date/time update
The forms in Microsoft Access have a Timer event.
For a form named frmMain with a label lblTime, you'd have code that
looks something like this:
Private Sub Form_Load()
With Me
.TimerInterval = 1
End With
End Sub
Private Sub Form_Timer()
with Me
.lblTime.Caption = Now()
End with
End Sub
Arno R - 12 Jan 2006 16:16 GMT
TimerInterval is milliseconds!
With the TimerInterval set to 1 there will be no 'time' left to do useful stuff ;-)
So I would set the TimerInterval to 1000 if I wanted to get the time correct every second...
But I would not want that... An accuracy of one minute would be enough for me.
Arno R
>> I used =now() in a text box and that nicely displays date and time at
>> the moment of opening
[quoted text clipped - 21 lines]
> End with
> End Sub
Beowulf - 12 Jan 2006 16:23 GMT
>>> I used =now() in a text box and that nicely displays date and time at
>>> the moment of opening
[quoted text clipped - 22 lines]
>
> TimerInterval is milliseconds!
Oops. I did say code that looks "something like this", though. I should
have caught that, though. Thanks for the correction.
> With the TimerInterval set to 1 there will be no 'time' left to do
> useful stuff ;-)
> So I would set the TimerInterval to 1000 if I wanted to get the time
> correct every second... But I would not want that... An accuracy of
>one minute would be enough for me.