Need Some Help (Newbie)
Author Message
Need Some Help (Newbie)

Alright...I've looked over this code a bit. And cant quite figure out why,
it wont work. But...all it is, is a simple little math program, it gives two
random numbers, then the user has to put in the answer...quite easy. It has
two buttons: "New Problem!" And "Check It!" And I hope you can figure out
what these are 'suppose' to do. However.. I caught a snag. If I type in the
correct answer, it will say "Correct Answer" but if I type in the wrong
answer...it says the same this. I think either my If...then...else statement
is messed up..or there is some other way the script needs to be to add two

Here's what I got....
--------------------------------------
Public Message1
Public Message2
------------------------------------
Private Sub CommandButton1_Click()
Label1 = Int((20 * Rnd) + 1)
Label3 = Int((20 * Rnd) + 1)
Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
Message2 = "Good Job " & UserName & ", You Got It Right!"
End Sub
------------------------------------
Private Sub CommandButton2_Click()
If TextBox1 = Label3 + Label1 Then
MsgBox Message1
Else
MsgBox Message2
End If
End Sub
----------------------------------
Private Sub Label3_Click()

End Sub
---------------------------------------
Private Sub UserForm_Click()

End Sub
----------------------------------------
Private Sub UserForm_Initialize()
End Sub

Tue, 17 Dec 2002 03:00:00 GMT
Need Some Help (Newbie)
Alright...I got this far...hehe..please bare with me and help. Thanks.
Well I do this script with subtraction no problem.. See I found out that the
script tacks the second number on the end, So...like 12 & 20...would come
out "1220" in the end. which isn't right...it should be "32" because that's
12 + 20.
I know there's a way around this....please...give a minute and help.
I appreciate it.

Quote:
> Alright...I've looked over this code a bit. And cant quite figure out why,
> it wont work. But...all it is, is a simple little math program, it gives
two
> random numbers, then the user has to put in the answer...quite easy. It
has
> two buttons: "New Problem!" And "Check It!" And I hope you can figure out
> what these are 'suppose' to do. However.. I caught a snag. If I type in
the
> correct answer, it will say "Correct Answer" but if I type in the wrong
> answer...it says the same this. I think either my If...then...else
statement
> is messed up..or there is some other way the script needs to be to add two

> Here's what I got....
> --------------------------------------
> Public Message1
> Public Message2
> ------------------------------------
> Private Sub CommandButton1_Click()
> Label1 = Int((20 * Rnd) + 1)
> Label3 = Int((20 * Rnd) + 1)
> Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
> Message2 = "Good Job " & UserName & ", You Got It Right!"
> End Sub
> ------------------------------------
> Private Sub CommandButton2_Click()
> If TextBox1 = Label3 + Label1 Then
> MsgBox Message1
> Else
> MsgBox Message2
> End If
> End Sub
> ----------------------------------
> Private Sub Label3_Click()

> End Sub
> ---------------------------------------
> Private Sub UserForm_Click()

> End Sub
> ----------------------------------------
> Private Sub UserForm_Initialize()
> End Sub

Tue, 17 Dec 2002 03:00:00 GMT
Need Some Help (Newbie)
If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then

--
Michael Harris
MVP Scripting

Alright...I got this far...hehe..please bare with me and help. Thanks.
Well I do this script with subtraction no problem.. See I found out that the
script tacks the second number on the end, So...like 12 & 20...would come
out "1220" in the end. which isn't right...it should be "32" because that's
12 + 20.
I know there's a way around this....please...give a minute and help.
I appreciate it.

Quote:
> Alright...I've looked over this code a bit. And cant quite figure out why,
> it wont work. But...all it is, is a simple little math program, it gives
two
> random numbers, then the user has to put in the answer...quite easy. It
has
> two buttons: "New Problem!" And "Check It!" And I hope you can figure out
> what these are 'suppose' to do. However.. I caught a snag. If I type in
the
> correct answer, it will say "Correct Answer" but if I type in the wrong
> answer...it says the same this. I think either my If...then...else
statement
> is messed up..or there is some other way the script needs to be to add two

> Here's what I got....
> --------------------------------------
> Public Message1
> Public Message2
> ------------------------------------
> Private Sub CommandButton1_Click()
> Label1 = Int((20 * Rnd) + 1)
> Label3 = Int((20 * Rnd) + 1)
> Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
> Message2 = "Good Job " & UserName & ", You Got It Right!"
> End Sub
> ------------------------------------
> Private Sub CommandButton2_Click()
> If TextBox1 = Label3 + Label1 Then
> MsgBox Message1
> Else
> MsgBox Message2
> End If
> End Sub
> ----------------------------------
> Private Sub Label3_Click()

> End Sub
> ---------------------------------------
> Private Sub UserForm_Click()

> End Sub
> ----------------------------------------
> Private Sub UserForm_Initialize()
> End Sub

Tue, 17 Dec 2002 03:00:00 GMT
Need Some Help (Newbie)
Thanks for your help Michael harris...

Quote:
> If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then

> --
> Michael Harris
> MVP Scripting

> Alright...I got this far...hehe..please bare with me and help. Thanks.
> Well I do this script with subtraction no problem.. See I found out that
the
> script tacks the second number on the end, So...like 12 & 20...would come
> out "1220" in the end. which isn't right...it should be "32" because
that's
> 12 + 20.
> I know there's a way around this....please...give a minute and help.
> I appreciate it.

> > Alright...I've looked over this code a bit. And cant quite figure out
why,
> > it wont work. But...all it is, is a simple little math program, it gives
> two
> > random numbers, then the user has to put in the answer...quite easy. It
> has
> > two buttons: "New Problem!" And "Check It!" And I hope you can figure
out
> > what these are 'suppose' to do. However.. I caught a snag. If I type in
> the
> > correct answer, it will say "Correct Answer" but if I type in the wrong
> > answer...it says the same this. I think either my If...then...else
> statement
> > is messed up..or there is some other way the script needs to be to add
two

> > Here's what I got....
> > --------------------------------------
> > Public Message1
> > Public Message2
> > ------------------------------------
> > Private Sub CommandButton1_Click()
> > Label1 = Int((20 * Rnd) + 1)
> > Label3 = Int((20 * Rnd) + 1)
> > Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It
Again!"
> > Message2 = "Good Job " & UserName & ", You Got It Right!"
> > End Sub
> > ------------------------------------
> > Private Sub CommandButton2_Click()
> > If TextBox1 = Label3 + Label1 Then
> > MsgBox Message1
> > Else
> > MsgBox Message2
> > End If
> > End Sub
> > ----------------------------------
> > Private Sub Label3_Click()

> > End Sub
> > ---------------------------------------
> > Private Sub UserForm_Click()

> > End Sub
> > ----------------------------------------
> > Private Sub UserForm_Initialize()