|
-
Feb 3rd, 2000, 06:47 PM
#1
Thread Starter
New Member
To VBWorld,
Please could you tell me what is wrong with this code as when I run it, it just shows the label caption as -1. Please help and email me at [email protected]
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Dim snds
snds = 60
Label1.Caption = snds
End Sub
Private Sub Timer1_Timer()
snds = snds - 1
Label1.Caption = snds
End Sub
THANKS FOR ANY HELP YOU CAN GIVE ME
jmcg
[email protected]
------------------
J.McGlory
-
Feb 3rd, 2000, 06:56 PM
#2
Addicted Member
That's problem which could be easier prevented when using Option Explicit...
You didn't declare the snds variable global. Just write Dim snds at the top of the Form source (maybe use Public instead of Dim).
Your variable was only declared for Form_Load but got the value 0 again when used in the timer.
0 - 1 is -1
------------------
Razzle
ICQ#: 31429438
-
Feb 3rd, 2000, 07:08 PM
#3
Thread Starter
New Member
Thanx I'll try it out now
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|