|
-
Dec 4th, 2000, 04:27 PM
#1
Thread Starter
Lively Member
Ok... i have this simple script but it does not seem to
work. I have a form with two textboxes. I want to retrieve
a time from the user. My script was doing just fine, until
I wanted to limit the input for seconds to 59. Caus' i.e.
2 minutes and 74 seconds is weird. So it made a simple
change. But now my script is acting weird and i get the
wrong messageboxes at the wrong moment. I just want a time
and when the user presses a button, it starts calculating
with it... can anybody HELP ME?
Here's my code:
Code:
Private Sub Command1_Click()
If Text1.Text = "" Then
GoTo error1
ElseIf Text2.Text = "" Then
GoTo error1
End If
If IsNumeric(Text1.Text) Then GoTo proceed Else GoTo error2
If IsNumeric(Text2.Text) Then GoTo proceed Else GoTo error2
proceed:
If Text2.Text > 59 Then
GoTo error3
Else
calculate
End If
error1:
MsgBox "Please enter a value"
GoTo endsub
error2:
MsgBox "Please enter a number"
GoTo endsub
error3:
MsgBox "Seconds must be below 60"
GoTo endsub
endsub:
End Sub
Since this:
Code:
If Text2.Text > 59 Then
it is acting weird...
-
Dec 4th, 2000, 04:41 PM
#2
Thread Starter
Lively Member
I am so dumb...
never mind...
i forgot to put goto endsub at the end of that part...
so it calculated the stuff... and then did a msgbox
with "please enter a value".... I am so dumb...
To VB or not to VB, that's the question...
-
Dec 4th, 2000, 04:57 PM
#3
Addicted Member
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
|