By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Is there a way to display current date and time on form?

P: n/a
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
Jan 12 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Try the "On Timer" event.

<je*********@pioneer.com> wrote in message
news:ol********************************@4ax.com...
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

Jan 12 '06 #2

P: n/a
<je*********@pioneer.com> wrote in message
news:ol********************************@4ax.com...
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

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?
Jan 12 '06 #3

P: n/a
je*********@pioneer.com wrote:
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


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
Jan 12 '06 #4

P: n/a
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

"Beowulf" <be*****************@hotmail.com> schreef in bericht news:Q6vxf.32001$sa4.22901@trnddc07...
je*********@pioneer.com wrote:
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


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

Jan 12 '06 #5

P: n/a
Just current date and time

Or are you talking about showing the date and time a record was created or
amended?


Jan 12 '06 #6

P: n/a
what object is on timer associated with
I don't see it in my event procedures for a text box

(VBA newbie)
Jerry

On Thu, 12 Jan 2006 10:00:34 -0600, "paii, Ron" <pa**@packairinc.com>
wrote:
Try the "On Timer" event.


Jan 12 '06 #7

P: n/a
Arno R wrote:
"Beowulf" <be*****************@hotmail.com> schreef in bericht news:Q6vxf.32001$sa4.22901@trnddc07...
je*********@pioneer.com wrote:
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 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


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.

Jan 12 '06 #8

P: n/a
<je*********@pioneer.com> wrote in message
news:lb********************************@4ax.com...
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")
Jan 12 '06 #9

P: n/a
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")


Jan 12 '06 #10

P: n/a
It is a Form event.

<je*********@pioneer.com> wrote in message
news:0g********************************@4ax.com...
what object is on timer associated with
I don't see it in my event procedures for a text box

(VBA newbie)
Jerry

On Thu, 12 Jan 2006 10:00:34 -0600, "paii, Ron" <pa**@packairinc.com>
wrote:
Try the "On Timer" event.

Jan 12 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.