Showing Latest Time On Form

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

Guest

Hi,

Is there a way, through VBA to show the latest date and time on a form?

I have seen it somewhere previously but after looking high and low for it, I
cannot find it anywhere on the internet. It shows the time down the the last
second and the user can see the time ticking.

Does anyone happen to know what it could be?

Many Thanks,

Kieron White
 
Hi,

Is there a way, through VBA to show the latest date and time on a form?

I have seen it somewhere previously but after looking high and low for it, I
cannot find it anywhere on the internet. It shows the time down the the last
second and the user can see the time ticking.

Does anyone happen to know what it could be?

Many Thanks,

Kieron White

Add an unbound text control to your form.
Name it 'TheTime'
Set it's Format property to General Time.

Display the Form's Property sheet.
Select the Event tab.
Set the timer Interval to
1000
Code the Timer event:
[TheTime] = Now()

Save the changes. Open the form.
The control will read in the format of:
7/29/2006 2:02:25 PM
and the seconds will increment.
 
In the Events tab of Properties, the OnTimer event allows you to enter code
to be executed when the timer "fires" and the TimerInterval allows you to
specify how often the timer fires (that number is only approximate because
of processes that can interfere, but is approximately in milliseconds, thus
1000 = approx. 1 second). If you forget that the unit of the interval is so
very small and set it to a low number, trying to execute the timer code
every few ms can be a performance hit.

Larry Linson
Microsoft Access MVP
 
Back
Top