The problem is that you're treating the timer element as a subroutine, and you're confusing it.
Demo code time:
Open a new project make 2 command buttons and 1 timer element
Double click on the command1 button and type timer1.interval=500
|
Quote:
|
Private Sub Command1_Click()
Timer1.Interval = 500
End Sub
|
go back to form, double click on the timer element and type command1.Left=command1.Left+5
|
Quote:
|
Private Sub Timer1_Timer()
Command1.Left = Command1.Left + 5
End Sub
|
go back to form, double click on the command2 button and type timer1.interval=0
|
Quote:
|
Private Sub Command2_Click()
Timer1.Interval = 0
End Sub
|
See? Timer element not subroutine. Timer exists outside of any other code.
Clicking on Command1 starts Command1 moving, Command2 stops Command1 moving.