Solved

timer not firing

Posted on 2014-02-02
18
191 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 45

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 45

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 45

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 45

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

758 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

18 Experts available now in Live!

Get 1:1 Help Now