Page 4 of 4 FirstFirst 1234
Results 121 to 159 of 159

Thread: [RESOLVED] Piecework Visual Basic 6.0

  1. #121
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Piecework Visual Basic 6.0

    explain...eactly what you want, in clear english, word for word.
    You are just posting random bits of code, which are of no use to anyone

    Woka

  2. #122
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Piecework Visual Basic 6.0

    What are:

    Mcurpaytotal and MinemployeeCount?

    Where do they get their values?

  3. #123

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

    Re: Piecework Visual Basic 6.0

    What i mean was to check the file for me and tell me what are my mistakes But don't change enything


    so Just tell me what to do and i correct it myself

  4. #124
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Piecework Visual Basic 6.0

    errr...well:
    VB Code:
    1. Dim MinemployeeCount  As Integer
    u have missed of the letter t.

    You have the start of a button click event with no End Sub

    You are using END!

    Instead of END use:
    VB Code:
    1. Unload me

    Woka

  5. #125
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Piecework Visual Basic 6.0

    I figured out you have to hit Calculate and then Mcurpaytotal gets a value.

    However, MinemployeeCount is never set to anything so curaveragepay = Mcurpaytotal / MinemployeeCount will always give you a divide by zero error.

    You are asking for the persons name when the form is loaded, yet in your summary button you are trying to figure out who did the most. You only have one name to begin with so that is a piece of information that is not available. You would have to have everyone fill out this form, save there entries to a database, then read back all of their records and calculate an average.

  6. #126

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

    Re: Piecework Visual Basic 6.0

    Thats correct now what should i do then ?

  7. #127

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

    Re: Piecework Visual Basic 6.0

    Today is my due date for my Homework

  8. #128

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

    Re: Piecework Visual Basic 6.0

    Dim MinemployeeCount As Integer

    I Have mised the t ? so where should i put it ?

  9. #129

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

    Re: Piecework Visual Basic 6.0

    Hello I am stuck in here Today is my due date for my project


    Help me

  10. #130
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    Outstanding assistance Hack .

  11. #131

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

    Re: Piecework Visual Basic 6.0

    Ahemmmm Need Help over here

  12. #132

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

    Re: Piecework Visual Basic 6.0

    Time to Panic Panic In a few hours

  13. #133
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    I must say I havn't read all the posts in this tread, however, how is it you can be at a stage in the course (far away down the track from "Hello World") and have gotten this far?

    You need to crawl before you can walk!

  14. #134

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

    Re: Piecework Visual Basic 6.0

    If intpieces < 200 Then
    Curprice = 0.5
    ElseIf intpieces < 400 Then
    Curprice = 0.55
    ElseIf intpieces < 600 Then
    Curprice = 0.6
    Else
    Curprice = 0.65
    End If


    Error

  15. #135

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

    Re: Piecework Visual Basic 6.0

    Hello word it the simplest but now i am stuck at this one

  16. #136

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

    Re: Piecework Visual Basic 6.0

    Private Sub cmdsummary_Click()
    'Calculate the average and dispaly the totals
    Dim curaveragepay As Currency
    Dim strmessage As String


    Error

  17. #137
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    What wa the Error?

    This worked for me (Note: don't copy it into your code block tho)

    VB Code:
    1. Option Explicit
    2.  
    3. Dim intPieces As Integer
    4. Dim Curprice As Currency
    5.  
    6. Private Sub Form_Load()
    7.  
    8.     intPieces = 300
    9.  
    10.     If intPieces < 200 Then
    11.         Curprice = 0.5
    12.     ElseIf intPieces < 400 Then
    13.         Curprice = 0.55
    14.     ElseIf intPieces < 600 Then
    15.         Curprice = 0.6
    16.     Else
    17.         Curprice = 0.65
    18.     End If
    19.  
    20.  
    21.     MsgBox Curprice
    22.  
    23. End Sub

  18. #138

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

    Re: Piecework Visual Basic 6.0

    uraveragepay = Mcurpaytotal / mintemployeecount
    strmessage = "Total number of pieces " & mintpiecesTotal & vbCrLf & _
    "Average Pay: " & FormatCurrency(curaveragepay) & cbCrLf & _
    "Person producing most: " & Mstrhighname & vbCrLf & _
    " (produced " & MintHighestpieces & " pieces)"
    MsgBox strmessage, vbOKOnly, "Piecework Summary"


    Error



    Guys now i can clear and calculate The Amount Earned Only {Only this worked)

  19. #139

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

    Re: Piecework Visual Basic 6.0

    View Post 136 & 138 Those are the error

  20. #140

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

    Re: Piecework Visual Basic 6.0

    VB Code:
    1. intPieces = 300
    2.  
    3.     If intPieces < 200 Then
    4.         Curprice = 0.5
    5.     ElseIf intPieces < 400 Then
    6.         Curprice = 0.55
    7.     ElseIf intPieces < 600 Then
    8.         Curprice = 0.6
    9.     Else
    10.         Curprice = 0.65
    11.     End If
    12.  
    13.  
    14.     MsgBox Curprice

    Check wheather i got this lines

    Pieces Completed
    1-199
    200-399
    400-599
    600 Or more

    Price Paid per Piece
    $0.50
    $0.55
    $0.60
    $0.65

  21. #141
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    Quote Originally Posted by Franklin67
    [Highlight=VB]
    Check wheather i got this lines
    Sorry, is that a question?

  22. #142

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

    Re: Piecework Visual Basic 6.0

    VB Code:
    1. intPieces = 300
    2.  
    3.     If intPieces < 200 Then
    4.         Curprice = 0.5
    5.     ElseIf intPieces < 400 Then
    6.         Curprice = 0.55
    7.     ElseIf intPieces < 600 Then
    8.         Curprice = 0.6
    9.     Else
    10.         Curprice = 0.65
    11.     End If
    12.  
    13.  
    14.     MsgBox Curprice
    15.  
    16.  
    17.  
    18. [Highlight=VB]Check wheather i got this lines
    19.  
    20. Pieces Completed
    21. 1-199
    22. 200-399
    23. 400-599
    24. 600 Or more
    25.  
    26. Price Paid per Piece
    27. $0.50
    28. $0.55
    29. $0.60
    30. $0.65

    Error[/Highlight]
    Last edited by Franklin67; Oct 18th, 2005 at 10:37 PM.

  23. #143
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    Ok...... I'll bite (for now)

    If you don't provide specific detail, no one will help you. As previously mentioned to you posting snippets with unsupported comments won't help.

    What on earth was the Error you got from the above example?

  24. #144

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

    Re: Piecework Visual Basic 6.0

    what i meant was check each line to see wheather i got the statements correct

  25. #145

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

    Re: Piecework Visual Basic 6.0

    Is that simple

  26. #146
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    Ok here is an example - DO NOT USE IT AS IS - use it as a guide.

    In a new project:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  
    5.     MsgBox Check_Price(1)
    6.     MsgBox Check_Price(456)
    7.     MsgBox Check_Price(800)
    8.  
    9. End Sub
    10.  
    11. Private Function Check_Price(ByVal intNumPieces As Integer) As Single
    12. Dim Curprice As Single
    13.  
    14.     If intNumPieces < 200 Then
    15.         Curprice = 0.5
    16.     ElseIf intNumPieces < 400 Then
    17.         Curprice = 0.55
    18.     ElseIf intNumPieces < 600 Then
    19.         Curprice = 0.6
    20.     Else
    21.         Curprice = 0.65
    22.     End If
    23.  
    24.     'Return the amount
    25.     Check_Price = Curprice
    26.  
    27. End Function

    Use this to demonstrate that you need to pass all PiecesCompleted to the Function.
    You may choose to do a For..Next and cycle all you values of PiecesCompleted in a Sub.

  27. #147

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

    Re: Piecework Visual Basic 6.0

    VB Code:
    1. [COLOR=Yellow]Private Sub cmdsummary_Click()[/COLOR]
    2.     'Calculate the average and dispaly the totals
    3. Dim curaveragepay       As Currency
    4. Dim strmessage          As String
    5.  
    6.  
    7. curaveragepay = [COLOR=DarkGreen]curpaytotal [/COLOR]/ mintemployeecount
    8. strmessage = "Total number of pieces " & mintpiecesTotal & vbCrLf & _
    9.                 "Average Pay:           " & FormatCurrency(curaveragepay) & cbCrLf & _
    10.                 "Person producing most: " & Mstrhighname & vbCrLf & _
    11.                 "   (produced " & MintHighestpieces & " pieces)"
    12. MsgBox strmessage, vbOKOnly, "Piecework Summary"
    13.  
    14. End Sub




    Is error

  28. #148
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    You need to impliment (add) that code to calc those prices!

  29. #149

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

    Re: Piecework Visual Basic 6.0

    How do i do that

  30. #150

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

    Re: Piecework Visual Basic 6.0

    Show Me

  31. #151
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,428

    Re: Piecework Visual Basic 6.0

    I can't in good faith continue to assist and have you pass a subject that you haven't the slightest grasp of - sorry


    Bye, bye.

  32. #152

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

    Re: Piecework Visual Basic 6.0

    People i am in the class help me as possible

  33. #153

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

    Re: Piecework Visual Basic 6.0

    Before I hand this over

  34. #154
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Piecework Visual Basic 6.0

    @ everyone else: That's what happens when you DON'T make an effort

    Let it be a lesson to all

  35. #155

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

    Re: [RESOLVED] Piecework Visual Basic 6.0

    No No You Guys Don't really understand what i was saying

  36. #156

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

    Re: [RESOLVED] Piecework Visual Basic 6.0

    [IMG]file:///D:/Games%20screenshots/ScreenHunter_150.bmp[/IMG]

  37. #157
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: [RESOLVED] Piecework Visual Basic 6.0

    Right. What's this picture got to do with anything?
    I've mentioned before that you must post explanations too!

    Posting "No, No, you guys don't understand"

    Then posting a bitmap means abosolutely nothing...to anybody.

    Can we please keep the thread "on topic" if that's at all possible, or i will be forced to close the thread

    Woka

  38. #158
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] Piecework Visual Basic 6.0

    *Sigh* this thread was on its way to dieing a natural death all on its own until everyone starting popping in with their comments. In fact, it was already on page 2 of this section.

    Enough, from everyone.
    Last edited by Hack; Oct 19th, 2005 at 08:34 AM.

  39. #159
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: [RESOLVED] Piecework Visual Basic 6.0

    Use "manage attachemnts" when you are editting a post in the ADVANCED mode. Click "Go Advanced" under the last post.

    BUT explian EVERYTHING about your pic.

    Woka

Page 4 of 4 FirstFirst 1234

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