Solved

timer not firing

Posted on 2014-02-02
18
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 47

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 47

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 47

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 47

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

696 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