xer0syk0
08-13-2005, 10:26 AM
Whenever i try to process any data from a textbox as an integer, it always becomes 0. For example:
Option Explicit
Dim Req1 As Integer
Dim Cur2 As Integer
Dim Num1 As Integer
Dim Number2 As Integer
Dim Rawr As Integer
Private Sub cmdProcess_Click()
Rawr = 149
txtReq1.Text = Req1
txtCur2.Text = Cur2
Num1 = ReqExp - CurExp
Num2 = Number / (Rawr * 2)
Text1.Text = Number2 + "" + "is the magical number."
End Sub
So...when people enter a number into Req1, and into Req2, and they hit the Process button, all values automatically become 0.
It produces a "Type mismatch" error. In debug, the value of Req1 = 0, and Cur2 = 0, and everything else, also = 0.
How do i correct this?
Can anyone help me?
Thanks.
Option Explicit
Dim Req1 As Integer
Dim Cur2 As Integer
Dim Num1 As Integer
Dim Number2 As Integer
Dim Rawr As Integer
Private Sub cmdProcess_Click()
Rawr = 149
txtReq1.Text = Req1
txtCur2.Text = Cur2
Num1 = ReqExp - CurExp
Num2 = Number / (Rawr * 2)
Text1.Text = Number2 + "" + "is the magical number."
End Sub
So...when people enter a number into Req1, and into Req2, and they hit the Process button, all values automatically become 0.
It produces a "Type mismatch" error. In debug, the value of Req1 = 0, and Cur2 = 0, and everything else, also = 0.
How do i correct this?
Can anyone help me?
Thanks.