dbTalk Databases Forums  

resetting timerinterval on main form from subform does not work

comp.databases.ms-access comp.databases.ms-access


Discuss resetting timerinterval on main form from subform does not work in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
KW
 
Posts: n/a

Default resetting timerinterval on main form from subform does not work - 02-11-2010 , 11:17 AM






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?

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: resetting timerinterval on main form from subform does not work - 02-11-2010 , 12:04 PM






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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.