programming

Private Sub cmdCalculate_Click()
' convert
mintPieces = Val(txtPieces.Text)

' calculate the pay
If mintPieces >= 1 And mintPieces <= 199 Then
mcurCurrentPay2 = mintPieces * 0.48
lblCurrentPay2.Caption = FormatCurrency(mcurCurrentPay2)
ElseIf mintPieces >= 200 And mintPieces <= 399 Then
mcurCurrentPay2 = mintPieces * 0.53
lblCurrentPay2.Caption = FormatCurrency(mcurCurrentPay2)
ElseIf mintPieces >= 400 And mintPieces <= 599 Then
mcurCurrentPay2 = mintPieces * 0.55
lblCurrentPay2.Caption = FormatCurrency(mcurCurrentPay2)
ElseIf mintPieces >= 600 Then
mcurCurrentPay2 = mintPieces * 0.58
lblCurrentPay2.Caption = FormatCurrency(mcurCurrentPay2)
End If
End Sub

Private Sub cmdSummary_Click()
Dim strName As String
Dim intPersonCount As Integer

strName = Val(txtName.Text)

intPersonCount = intPersonCount + 1
mintTotalPieces2 = mintTotalPieces2 + mintPieces
lblTotalPieces2.Caption = FormatNumber(mintTotalPieces2, 0)
mintNumber2 = mintNumber2 + 1
lblNumber2.Caption = FormatNumber(mintNumber2, 0)
mcurAverage2 = mcurAverage2 / mcurCurrentPay2
lblAverage2.Caption = FormatCurrency(mcurAverage2)
mcurTotal2 = mcurAverage2 + mcurTotal2
lblTotal2.Caption = FormatCurrency(mcurTotal2)
End Sub

0 comments: