I keep getting an error messege that says :

Conversion from string "" to type "integer" is not valid?!?!!?

what should i do?? what am i doing wrong?




Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculate.Click

Dim thenumber, theterms, z As Integer
Dim thesum As Decimal


thenumber = CInt(number.Text)
theterms = CInt(terms.Text)
thesum = CDec(sum.Text)

theterms = 1
thesum = 0


Do Until thesum > thenumber
z = 1 / theterms
thesum = z
Exit Do
z = z + z
theterms = theterms + 1

Loop

terms.Text = CStr(theterms)
sum.Text = CStr(thesum)





End Sub
End Class