On Timer Event

Posted on 2011-04-26
Medium Priority
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
  • 2
  • 2
LVL 31

Accepted Solution

hnasr earned 2000 total points
ID: 35471477

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

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


Author Comment

ID: 35471516
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.

Author Comment

ID: 35471524
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 31

Expert Comment

ID: 35471580
"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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 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