Clock or operator error?

  • Thread starter Thread starter Rohn
  • Start date Start date
R

Rohn

I want to add a running clock to a form. I used the following code in an older database and it seemed works. It wont work on my Access 2000.



I created a Label called lblClock on my form. Then I set the TimerInterval on the form to 1000 and put the following code in the Timer Event.



****************

Private Sub Form_Timer()

Me!lblClock.Caption = Format(Now, "dddd, mmm d 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

****************

I get, Run-time error '438': Object doesn't support this property or method



Any ideas on what I am doing wrong?

Thanks, Rohn
 
Rohn said:
I want to add a running clock to a form. I used the following code in an older database and it seemed works. It wont work on my Access 2000.



I created a Label called lblClock on my form. Then I set the TimerInterval on the form to 1000 and put the following code in the Timer Event.



****************

Private Sub Form_Timer()

Me!lblClock.Caption = Format(Now, "dddd, mmm d 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

****************

I get, Run-time error '438': Object doesn't support this property or method



Any ideas on what I am doing wrong?

Thanks, Rohn


Rohn,

The good news is the code you posted works in A2K.

The bad news is the code you posted works in Ac2K........ <grin>


I created a label and two buttons, used your names and pasted in the
code. When I clicked on the start button, the date/time appeared and
started incrementing. The label has to be really wide - 2.25".


Where is the error occurring? Check the control names, maybe your
computer can't spell very well.... mine is always adding or changring
wordes...

Set a break point in the cmdClockStart_Click() code and trace the code.


It shoule work... <grin> (darn conputer!!!)


HTH
 
My error....

It works on my older database A2k but now that I have upgraded to A2002 and
then this week to A2003 my clocks don't work?

Same everything.... just a different version and it wont work! Do I need
different code or something!

thanks for the help so far, Rohn


"sanfu at techie dot com" <"sanfu at techie dot com"> wrote in message
Rohn said:
I want to add a running clock to a form. I used the following code in an
older database and it seemed works. It wont work on my Access 2000.
I created a Label called lblClock on my form. Then I set the TimerInterval
on the form to 1000 and put the following code in the Timer Event.
****************

Private Sub Form_Timer()

Me!lblClock.Caption = Format(Now, "dddd, mmm d 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

****************

I get, Run-time error '438': Object doesn't support this property or method



Any ideas on what I am doing wrong?

Thanks, Rohn


Rohn,

The good news is the code you posted works in A2K.

The bad news is the code you posted works in Ac2K........ <grin>


I created a label and two buttons, used your names and pasted in the
code. When I clicked on the start button, the date/time appeared and
started incrementing. The label has to be really wide - 2.25".


Where is the error occurring? Check the control names, maybe your
computer can't spell very well.... mine is always adding or changring
wordes...

Set a break point in the cmdClockStart_Click() code and trace the code.


It shoule work... <grin> (darn conputer!!!)


HTH
 
Back
Top