Re: NEED QUICK HELP IN VB6
Program 1:
Select Case intScore
Case is > 89
strGrade = A
Case is > 79
strGrade = B
Case is > 69
strGrade = C
Case is > 59
strGrade = D
Case else
strGrade = F
End Select
Re: NEED QUICK HELP IN VB6
Program 2:
This a is quick idea of how to do it. Put a command button and a standard grid on a form and use the code below. When you click on the command button it will populate the grid with the balance, amount paid on principle, and amount paid in interest.
NOTE: Due to rounding it may be a off a penny.
private Sub Command1_Click()
Dim i as Integer
Dim rate as string
Dim bal as string
Dim pay as string
Dim interest as string
Dim prince as string
rate = ".01"
rate = Format$(rate, "0.00")
pay = "116.00"
pay = Format$(pay, "0.00")
bal = "563.00"
bal = Format$(bal, "0.00")
'Widen grid columns
for i = 0 to 2
Grid1.ColWidth(i) = 750
next
' First column shows initial balance and balance after each payment
' Second column shows amount paid on principle for each payment
' Third Column shows amount paid in interest for each payment
'Loops to populate each row with data in three columns
for i = 0 to 4
'Balance (col 1)
Grid1.Col = 0
Grid1.Row = i
Grid1.Text = Format$(bal, "0.00")
interest = Format$(rate * bal, "0.00")
'Priciple payment (col 2)
Grid1.Col = 2
Grid1.Row = i
Grid1.Text = interest
prince = Format$("116.00" - interest, "0.00")
'Interest payment (col 3)
Grid1.Col = 1
Grid1.Row = i
Grid1.Text = prince
bal = bal - prince
next
End Sub