Solved

timer not firing

Posted on 2014-02-02
18
195 Views
Last Modified: 2014-03-03
From form frmBonus12
frmBonusWin.StartTimer

in calling this sub it does not fire the timer


Public Sub StartTimer()
     Timer2.Interval = 1000
        Timer2.Enabled = True
End Sub

it does not go to the timer at all

Private Sub Timer2_Timer()
    If mTime <= 3 Then
       'Timer2.Enabled = True
       mTime = mTime + 1
     If mTime >= 4 Then
       Timer2.Enabled = False
       Me.Visible = False
       frmCleo.Show
       frmCleo.AddBonusWinnings
     End If
     
    End If
End Sub
what could cause this ?
0
Comment
Question by:isnoend2001
  • 8
  • 4
  • 3
  • +1
18 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 39828857
Have you debugged the application? What would happend if the condition mTime >= 4 true while starting the timer. It will be disabled. Kindly debug the application.

Whether the method Timer2_Timer is weired with the Tick event of the timer correctly? If not, please correct it.
0
 

Author Comment

by:isnoend2001
ID: 39828871
yes i have debugged it. it does not even hit this line:
Private Sub Timer2_Timer
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 39828978
Whether the method StartTimer() being hit?

I suspect that the Timer is not enabled. Or Disabled somewhere in your application. Please do check it out.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 15

Expert Comment

by:eemit
ID: 39829544
It seems like you've misspelled the Form name. Instead of:
frmBonusWin.StartTimer

Open in new window

Try:
Me.StartTimer

Open in new window

0
 

Author Comment

by:isnoend2001
ID: 39829595
Me.StartTimer will not work as the public sub is called from another form

put a break on Public Sub StartTimer stepping thru each line it does not start timer
it steps all the way to end sub without going to the timer
Public Sub StartTimer()
     Timer2.Interval = 1000
        Timer2.Enabled = True
End Sub
0
 
LVL 15

Expert Comment

by:eemit
ID: 39829651
Check is the Timer2 control in frmBonusWin.
0
 

Author Comment

by:isnoend2001
ID: 39829704
Re: Check is the Timer2 control in frmBonusWin.
What do you mean ?
0
 

Author Comment

by:isnoend2001
ID: 39829734
I have tried this:
deleted timer1
put a new timer named it timer2
mTime = 0 < added this to make sure
set the timer to Timer2.Enabled = false before true
closed and opened the ide
rebooted
nothing works what else can I try, even a longshot
0
 
LVL 15

Expert Comment

by:eemit
ID: 39829771
Are both: Timer2 Control and Code of Private Sub Timer2_Timer() in Form frmBonusWin?
0
 

Author Comment

by:isnoend2001
ID: 39829803
in the calling form named frmCleoBonus
             Load frmBonusWin
             Me.Visible = False
             frmBonusWin.StartTimer< starts the timer here
             frmBonusWin.Show
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39829910
Can you attach your project please?
0
 

Author Comment

by:isnoend2001
ID: 39830045
MartinLiss this is the same project you have helped me with many times
Needs a lot of tweaking
The bonus part is the problem.
Unfortunately you have to hit a bonus to test
After clicking start click autoplay same button.
To see how a bonus is won read the top left text on the main form
I have found that marking 10 numbers is the best chance for hitting a bonus
When a bonus is won frmBonus12 is shown for a few seconds
Then
frmCleoBonus runs 12 times with all the wins doubled
After the 12 bonus runs
if a win then
frmBonusWin is shown for a few seconds the win is added to frmCleo
if not a win then frmBonusComplete is shown for a few seconds
then frmCleo is shown and autoplay continues if it was in that mode
For-EE.zip
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39830128
I know it's the same, I just wanted the latest code. Can you tell me where to find the code that checks to see if a bonus is to be awarded?
0
 

Accepted Solution

by:
isnoend2001 earned 0 total points
ID: 39830139
Martinliss the project starting working correctly. don't know why
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39830154
OK, no problem. Let me know if you need any more help.
0
 

Author Comment

by:isnoend2001
ID: 39830165
frmCleo
Sub Generate20Numbers line 1730
ColHits(20) the 20th number drawing line 1826
If mLastBallHitMarkedNumber = True And mWinningRun = True Then line 1844
Load frmBonus12 line 1861
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39899996
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 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