With monday.comâ€™s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.
Private Sub calcbutton_Click(sender As System.Object, e As System.EventArgs) Handles calcbutton.Click
'The car price should appear in terms of dollars and cents.
Dim carprice As Double
'The APR needs two percentage points
Dim interestrate As Double
'Money down should be dollars and cents
Dim moneydown As Double
'Dim loan term As Double
Dim loanterm As Double
'Dim Payment as Double
Dim payment As Double
Dim monthlyinterest As Double
Dim months As Double
Dim loanamount As Double
'Declare where the values are coming from
carprice = Val(Carpricetext.Text)
interestrate = Val(IRTextbox.Text)
moneydown = Val(Dwnpymnttext.Text)
loanterm = Val(LnTrmList.SelectedValue)
loanamount = (carprice - moneydown)
Do While loanterm <= 5
monthlyinterest = (interestrate / 100) / 12
months = 12 * loanterm
'calculate payments - rate * month = monthly payments
payment = _
Pmt(monthlyinterest, months, -loanamount)
'displays results
paymenttxt.Text = payment
Loop
End Sub
loanterm = Val(LnTrmList.SelectedValu 'Declare where the values are coming from
carprice = Val(Carpricetext.Text)
interestrate = Val(IRTextbox.Text)
moneydown = Val(Dwnpymnttext.Text)
loanterm = Val(LnTrmList.SelectedItem)
loanamount = (carprice - moneydown)
monthlyinterest = (interestrate / 100) / 12
months = 12 * loanterm
'calculate payments - rate * month = monthly payments
payment = Pmt(monthlyinterest, months, -loanamount)
'displays results
paymenttxt.Text = payment
'The car price should appear in terms of dollars and cents.
Dim carprice As Double
'The APR needs two percentage points
Dim interestrate As Double
'Money down should be dollars and cents
Dim moneydown As Double
'Dim loan term As Double
Dim loanterm As Double
'Dim Payment as Double
Dim payment As Double
Dim monthlyinterest As Double
Dim months As Double
Dim loanamount As Double
'Declare where the values are coming from
carprice = Val(Carpricetext.Text)
interestrate = Val(IRTextbox.Text)
moneydown = Val(Dwnpymnttext.Text)
loanterm = Val(LnTrmList.SelectedItem)
loanamount = (carprice - moneydown)
monthlyinterest = (interestrate / 100) / 12
months = 12 * loanterm
'calculate payments - rate * month = monthly payments
payment = Pmt(monthlyinterest, months, -loanamount)
'displays results
paymenttxt.Text = payment
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Payment As Double
Dim loanamount As Double = (Val(TextBox1.Text) - Val(TextBox3.Text))
Dim monthlyinterest As Double = (Val(TextBox2.Text) / 100) / 12
Dim loanterm = Val(ListBox1.SelectedItem)
Dim months = 12 * loanterm
'calculate payments - rate * month = monthly payments
Payment = Pmt(monthlyinterest, months, -loanamount)
'displays results
TextBox4.Text = Payment
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Add("1")
ListBox1.Items.Add("2")
ListBox1.Items.Add("3")
ListBox1.Items.Add("4")
ListBox1.Items.Add("5")
End Sub
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
I'm not in front of a box with VB on it, but I think that's where you're slightly awry.
Use your trace environment and watches to keep an eye on LnTrnList.SelectedItem.Val