On Timer Event

Posted on 2011-04-26
Last Modified: 2012-08-14
I have this code that I have created that I am trying to run on the timer event of the main form. It does not seem to work. Can somebody please look at this and see what I am doing wrong?
Private Sub MyTimer()
StartTime = conStartTime
EndTime = 4000
If Not IsLoaded("frmPPT") Then
    Do While EndTime > StartTime
        StartTime = StartTime + 1
        Select Case StartTime
            Case 30
            Case 90
            Case 4000
                DoCmd.OpenForm "frmPPT"
        End Select
End If
End Sub

I have
Dim StartTime As Single
Dim EndTime As Single
Private Const conStartTime = 1

in general declarations.
Question by:mona4980
    LVL 30

    Accepted Solution


    Set form properties.
    On Timer event procedure.
    Timer interval : 1000

    Private Sub Form_Timer()
        ' code here, try and post feedback.
    End Sub

    LVL 1

    Author Comment

    I have set the timer event as you stated. The deal is I need the timer to do two events. so that is why I made MyTimer. If i put the MyTimer in the event then it just loops and goes to do the  DoCmd.OpenForm "frmPPT". the first time through the loop it changes the image on the form as it is supposed to but not after it loops through again.
    LVL 1

    Author Comment

    I have solved the problem by opening a form hidden that opens the form with the image on it and I can use the initial forms timer event to go through the pics.
    then on the hidden forms timer it will open the frmPPT. there is some code I put in frmPPT to go through the Powerpoint presentation one frame at a time and then when it is done to close.
    LVL 30

    Expert Comment

    "I have solved the problem "
    Comments are just to help you solve the problem. They open ways for your excellence to shine!
    Good luck!

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now