Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

timer not firing

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
isnoend2001
Asked:
isnoend2001
  • 8
  • 4
  • 3
  • +1
1 Solution
 
Easwaran ParamasivamCommented:
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
 
isnoend2001Author Commented:
yes i have debugged it. it does not even hit this line:
Private Sub Timer2_Timer
0
 
Easwaran ParamasivamCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
eemitCommented:
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
 
isnoend2001Author Commented:
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
 
eemitCommented:
Check is the Timer2 control in frmBonusWin.
0
 
isnoend2001Author Commented:
Re: Check is the Timer2 control in frmBonusWin.
What do you mean ?
0
 
isnoend2001Author Commented:
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
 
eemitCommented:
Are both: Timer2 Control and Code of Private Sub Timer2_Timer() in Form frmBonusWin?
0
 
isnoend2001Author Commented:
in the calling form named frmCleoBonus
             Load frmBonusWin
             Me.Visible = False
             frmBonusWin.StartTimer< starts the timer here
             frmBonusWin.Show
0
 
Martin LissRetired ProgrammerCommented:
Can you attach your project please?
0
 
isnoend2001Author Commented:
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
 
Martin LissRetired ProgrammerCommented:
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
 
isnoend2001Author Commented:
Martinliss the project starting working correctly. don't know why
0
 
Martin LissRetired ProgrammerCommented:
OK, no problem. Let me know if you need any more help.
0
 
isnoend2001Author Commented:
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
 
Martin LissRetired ProgrammerCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 8
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now