Crons

  • Thread starter Thread starter Downie
  • Start date Start date
D

Downie

I have a text box field with a default value of Now() on my Form that I
would like to automatically update every minute or so.

Is there and code out there that will automate this for me..come sort
of cron I believe?



Private Sub Text21_BeforeUpdate(Cancel As Integer)

End Sub
 
I have a text box field with a default value of Now() on my Form that I
would like to automatically update every minute or so.

Ummm... I think you're crossing wires here.

The DefaultValue property is what will actually be saved to the table
when the user "dirties" the record. It will be a static display, but
will actually save the current time when the user types into any other
field. No update code is required.

Do you want a label to DISPLAY the current system time? If so, use a
Label control (different from this bound textbox), and code in the
Form's Timer event. Set the form's TimerInterval property to 60000
(milliseconds, one minute) and use code

Private Sub Form_Timer()
Me!lblClock.Caption = Format(Time, "hh:nn")
End Sub

Be sure to disable the timer by setting TimerInterval to 0 or closing
this form if you are going to work in the VBA editor - a running timer
does WIERD things when the editor is open!

John W. Vinson[MVP]
 
Back
Top