I am writing a program that is embedded in a word document that allows a college student to select from one of two computers. When the computer is selected the program will display to total with tax + shipping on a placed label. I have fished this portion of the code fine.
The problem I am up against right now is the document requires a access pane on the right of the document which calculates the monthly payment based on an interest rate, months loaned and principal
I cant for the life of me get the access pane to compute a total. I worked some code it that i referenced from a similar project I had worked on in the past.
any guidance would be really appreciated
Attached in the project if anyone is willing to run it and take a peak.
here is the code for the accesspane
Public Class ActionsPaneControl
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbomonths.SelectedIndexChanged
End Sub
Private Sub ActionsPaneControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Intrestrate_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Intrestrate.TextChanged
End Sub
Private Sub btnpayment_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpayment.Click
Dim decintrestrate As Decimal
Dim decperiod As Decimal
Dim decprincipal As Decimal
Dim monthlypayments As Decimal
Dim dectwelvemonths As Decimal = 12D
Dim blnperiodisvalid As Boolean = False
Dim Decmovedecimal As Decimal = 100D
checkperiodvalidity(blnperiodisvalid, decperiod)
If IsNumeric(Intrestrate.Text) And IsNumeric(Principal.Text) And blnperiodisvalid Then
decintrestrate = Convert.ToDecimal(Intrestrate.Text) / Decmovedecimal
decprincipal = Convert.ToDecimal(Principal.Text)
monthlypayments = Convert.ToDecimal(Pmt(decintrestrate / _
dectwelvemonths, decperiod, decprincipal))
monlbl.Text = monthlypayment.ToString
Else
MsgBox("the input entries on the loan calculator are not valid", , "Error Message")
End If
End Sub
Private Sub Checkperiodvalidity(ByRef blnvalidity As Boolean, ByRef decmonths As Decimal)
If cbomonths.selecteditem = "" Then
If IsNumeric(cbomonths.text) Then
decmonths = Convert.todecimal(cbomonths.Text)
blnvalidity = True
Else
blnvalidity = False
End If
Else
decmonths = Convert.todecimal(cbomonths.selecteditem)
blnvalidity = True
End If
End Sub
End Class
WordDocument2.rar <-------- ATTACHED IS THE PROJECT IF ANYONE IS WILLING TO RUN IT AND TAKE A PEAK