simple/compound interest calculator
we also had to create a simple and a compound calculator all in one and this is proving to be trouble some for me so can some one help
Dim p As Double
Dim i As Double
Dim l As Double
Dim m As Double
Dim j As Double
Dim simp As Double
Dim comp As Double
Private Sub optMonths_Click()
i = txt2.Text
p = txt1.Text
l = txt3.Text
comp = (p(1 + i) / l)
simp = (p * i * l)
End Sub
Private Sub optYears_Click()
i = txt2.Text
p = txt1.Text
l = txt3.Text
comp = (p(1 + i) ^ l)
simp = (p * i * l)
End Sub
Private Sub cmdClear_Click()
txt1 = ""
txt2 = ""
txt3 = ""
txt4 = ""
txt5 = ""
txt6 = ""
txt7 = ""
txt1.Enabled = True
txt1.SetFocus
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Label1_Click()
End Sub
Private Sub cmdReturn_Click()
Unload Me
Money.Hide
menu.Show
End Sub
Private Sub txt1_KeyPress(KeyAscii As Integer)
txt1.SetFocus
If KeyAscii = 46 Then
KeyAscii = 46
ElseIf KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Private Sub txt2_KeyPress(KeyAscii As Integer)
txt2.SetFocus
If KeyAscii = 46 Then
KeyAscii = 46
ElseIf KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Private Sub txt3_KeyPress(KeyAscii As Integer)
txt3.SetFocus
If KeyAscii = 46 Then
KeyAscii = 46
ElseIf KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Private Sub txt6_KeyPress(KeyAscii As Integer)
txt6.SetFocus
If KeyAscii = 46 Then
KeyAscii = 46
ElseIf KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Private Sub txtFutval_KeyPress(KeyAscii As Integer)
txtFutval.SetFocus
If KeyAscii = 46 Then
KeyAscii = 46
ElseIf KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Re: simple/compound interest calculator
You will find the Answer here