Results 1 to 40 of 159

Thread: [RESOLVED] Piecework Visual Basic 6.0

Threaded View

  1. #11

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Location
    Singapore
    Posts
    99

    Re: Piecework Visual Basic 6.0

    Public Function GetPayPerEmp (lngTotalPcs As Long) As Currency Select Case lngTotalPcs.
    (ONLY THis one)


    Dim curAverage As Currency
    Dim intQuantity As Integer
    Dim curAmount As Currency
    Dim strMessageString As String
    Dim strFormattedAvg As String
    Dim strFormattedPay As String
    Dim curPrice As Currency
    Dim CalculatedPay As Currency
    Dim lngSampleVar As Currency


    'Display a summary message box

    intQuantity = Val(txtPieces.Text)
    curAmount = intQuantity * curPrice

    mintTotalNumber = mintTotalNumber + intQuantity
    mcurTotalPay = mcurTotalPay + curAmount
    mintCustomerCount = mintCustomerCount + 1
    curAverage = mcurTotalPay / mintCustomerCount


    'Format the numbers

    strFormattedAvg = FormatCurrency(curAverage, 2)
    strFormattedPay = FormatCurrency(mcurTotalPay, 2)
    strMessageString = "Total number of pieces: " & mintTotalNumber & vbCrLf & _
    "Total Pay: " & strFormattedPay & vbCrLf & _
    lblAmount.Caption = FormatCurrency(curAmount, 2)
    CmdCalculate.Enabled = False

    strMessageString = "Total number of pieces: " & mintTotalNumber & vbCrLf & _
    "Total Pay: " & strFormattedPay & vbCrLf & _
    "Average Pay: " & strFormattedPay
    MsgBox strMessageString, vbInformation, "Piecework summary"


    Private Sub Cmdcalculate_Click()

    Public Function GetPayPerEmp (lngTotalPcs As Long) As Currency Select Case lngTotalPcs.
    Case 1 To 199
    GetPayPerEmp = lngTotalPcs * 0.5
    Case 200 To 299
    GetPayPerEmp = lngTotalPcs * 0.55

    Case 400 To 599
    GetPayPerEmp = ingtotalpcs * 0.6

    Case Is > 599
    GetPayPerEmp = ingtotalpcs * 0.65
    End Function

    and now am i missing anything ?
    Last edited by Franklin67; Oct 3rd, 2005 at 09:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width