KW wrote:
Quote:
It seems that resetting the timerinterval for a main form from an
event in a subform does not work.
The code within the subform's event is:
Forms!MainFormName.TimerInterval = 0
Forms!MainFormName.TimerInterval = timerVal
The timer event on the main form fires prematurely. Stepping through
breakpoints in code, the main form's TimerInterval value does get
changed correctly, but it doesn't seem to use it.
Any ideas? |
That seemed like a unique problem so I checked it out. I set the main
form's timer(form name is F) interval to 5000 (5 secs). My OnTImer
event in the mainform is
Private Sub Form_Timer()
Dim lngVal As Long
lngVal = Me.TimerInterval
Me.TimerInterval = 0
msgbox "My timer interval is " & lngVal
Me.TimerInterval = lngVal
End Sub
In the subform, I placed the following code.
Private Sub Text0_GotFocus()
Forms!f.Form.TimerInterval = 6000
End Sub
Private Sub Text0_LostFocus()
Forms!f.Form.TimerInterval = 5000
End Sub
It seems to work just fine. I get the proper timer interval message in
the main form. I might be doing something different than you. I
noticed I specify .form. when setting from the subform.