now() function ?

  • Thread starter Thread starter Thomas Harvey via AccessMonster.com
  • Start date Start date
T

Thomas Harvey via AccessMonster.com

I have a radio log field 1 is date and field 2 is time, what I need to be
able to do is have the date default to the date which is no problem but the
time field when the record is open defaults to the time which is good
except when I don't want to fill the record out for a while in which case
the time is wrong. I would like it to fill out the time when I tab into
this field. Also sometimes we get behind and need to fill in the field
manualy to catch up. So I would like the time field to fill in the time
when I tab into it or out of it and I would like to be able to change it if
I need to

thanks
 
Thomas,

First of all, my recommendation would be to just have one field for the
date and time together. Then, instead of using the Default Value of the
control, you could put code on the Enter event of the control, like this...
Me.YourDateAndTime = Now

Either way, you should be able to edit this value if necessary, so I am
not sure whether the meaning of your post is that for some reason the
time isn't editable for some reason?
 
Hi.
Do you know how to create the clock on forms in Access?

I create a Label called lblClock on the form and write this code.

Private Sub Form_Timer()
Me!lblClock.Caption = Format(Now, "dddd, mmmm yyyy, hh:mm:ss AMPM")
End Sub

Private Sub cmdClockStart_Click()
Me.TimerInterval = 1000
End Sub

Private Sub cmdClockEnd_Click()
Me.TimerInterval = 0
End Sub

These code working but I most always click on the label lblClock.

I just want to the clock with normaly time on the form, no break or no
click.

Thanks
 
Dragan,

Just set the form's Timer Interval to 1000 and leave it there. Don't
use any code to change the Timer Interval. That way, the clock display
should constantly update every second. However, it is possible that you
need a line in the Timer event code:
Me.Repaint
[/QUOTE]
 
Back
Top