• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Does form containing a timer control need to have focus for timer to work?

Does form containing a timer control need to have focus for an enabled timer to work?
0
lee88
Asked:
lee88
1 Solution
 
clarkscottCommented:
No.  The form must be open, though.

Also, please read about the DOEVENTS statement.
Depending on MODAL type functions, you may need to include DOEVENT inside loops, etc, to ensure the 'other' processes continue to run.

This can be tested by putting a STOP in the timer code and try running some of your other forms and routines.  If the timer is running, the STOP will occur - otherwise - add the DOEVENTS statement in your code and re-test.



Scott C
0
 
GrahamSkanRetiredCommented:
No.
Try this
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 1000
Form2.Show
Form2.SetFocus
End Sub
 
Private Sub Timer1_Timer()
Form2.Hide
End Sub

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now