?
Solved

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

Posted on 2008-11-13
2
Medium Priority
?
249 Views
Last Modified: 2013-11-05
Does form containing a timer control need to have focus for an enabled timer to work?
0
Comment
Question by:lee88
2 Comments
 
LVL 20

Accepted Solution

by:
clarkscott earned 2000 total points
ID: 22949886
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22949906
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question