Associate
- Joined
- 22 May 2004
- Posts
- 1,792
- Location
- N.Ireland
Hi guys am doing an assigment for tech and am trying to do this
But the program is showing up an error Error Value of type 'String' cannot be converted to 'System.Windows.Forms.TextBox'.
Anyone know why the calulation wont go to the text boxes? Help please Please please LOL
Gareth
Code:
Public Class Simple
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
'Declare local Variable
Dim dblInterest, dblInvested, dblYears As Double
Dim dblInterestEarned, dblTotal As Double
'Input Values from User
dblInterest = Val(Me.txtInterest.Text)
dblInvested = Val(Me.txtAmount.Text)
dblYears = Val(Me.txtYears.Text)
'Perform Calculations based upon input Values
dblInterestEarned = dblInvested * dblInterest * dblYears / 100
dblTotal = dblInterestEarned + dblInvested
'Output results to Form
Me.txtInterestEarned = Cstr(dblInterestEarned)
Me.txtAmountEarned = Cstr(dblTotal)
End Sub
End Class
But the program is showing up an error Error Value of type 'String' cannot be converted to 'System.Windows.Forms.TextBox'.
Anyone know why the calulation wont go to the text boxes? Help please Please please LOL

Gareth