-
Oct 18th, 2005, 11:18 AM
#121
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
-
Oct 18th, 2005, 11:22 AM
#122
Re: Piecework Visual Basic 6.0
What are:
Mcurpaytotal and MinemployeeCount?
Where do they get their values?
-
Oct 18th, 2005, 11:28 AM
#123
Thread Starter
Lively Member
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
-
Oct 18th, 2005, 11:31 AM
#124
Re: Piecework Visual Basic 6.0
errr...well:
VB Code:
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:
Woka
-
Oct 18th, 2005, 11:32 AM
#125
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.
-
Oct 18th, 2005, 08:44 PM
#126
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Thats correct now what should i do then ?
-
Oct 18th, 2005, 09:00 PM
#127
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Today is my due date for my Homework
-
Oct 18th, 2005, 09:02 PM
#128
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Dim MinemployeeCount As Integer
I Have mised the t ? so where should i put it ?
-
Oct 18th, 2005, 09:29 PM
#129
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Hello I am stuck in here Today is my due date for my project
Help me
-
Oct 18th, 2005, 09:31 PM
#130
Re: Piecework Visual Basic 6.0
Outstanding assistance Hack .
-
Oct 18th, 2005, 09:39 PM
#131
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Ahemmmm Need Help over here
-
Oct 18th, 2005, 09:45 PM
#132
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Time to Panic Panic In a few hours
-
Oct 18th, 2005, 09:51 PM
#133
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!
-
Oct 18th, 2005, 09:54 PM
#134
Thread Starter
Lively Member
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
-
Oct 18th, 2005, 10:01 PM
#135
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
Hello word it the simplest but now i am stuck at this one
-
Oct 18th, 2005, 10:08 PM
#136
Thread Starter
Lively Member
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
-
Oct 18th, 2005, 10:09 PM
#137
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:
Option Explicit
Dim intPieces As Integer
Dim Curprice As Currency
Private Sub Form_Load()
intPieces = 300
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
MsgBox Curprice
End Sub
-
Oct 18th, 2005, 10:14 PM
#138
Thread Starter
Lively Member
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)
-
Oct 18th, 2005, 10:15 PM
#139
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
View Post 136 & 138 Those are the error
-
Oct 18th, 2005, 10:17 PM
#140
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
VB Code:
intPieces = 300
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
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
-
Oct 18th, 2005, 10:22 PM
#141
Re: Piecework Visual Basic 6.0
Originally Posted by Franklin67
[Highlight=VB]
Check wheather i got this lines
Sorry, is that a question?
-
Oct 18th, 2005, 10:25 PM
#142
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
VB Code:
intPieces = 300
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
MsgBox Curprice
[Highlight=VB]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
Error[/Highlight]
Last edited by Franklin67; Oct 18th, 2005 at 10:37 PM.
-
Oct 18th, 2005, 10:36 PM
#143
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?
-
Oct 18th, 2005, 10:39 PM
#144
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
what i meant was check each line to see wheather i got the statements correct
-
Oct 18th, 2005, 10:42 PM
#145
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
-
Oct 18th, 2005, 10:44 PM
#146
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:
Option Explicit
Private Sub Form_Load()
MsgBox Check_Price(1)
MsgBox Check_Price(456)
MsgBox Check_Price(800)
End Sub
Private Function Check_Price(ByVal intNumPieces As Integer) As Single
Dim Curprice As Single
If intNumPieces < 200 Then
Curprice = 0.5
ElseIf intNumPieces < 400 Then
Curprice = 0.55
ElseIf intNumPieces < 600 Then
Curprice = 0.6
Else
Curprice = 0.65
End If
'Return the amount
Check_Price = Curprice
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.
-
Oct 18th, 2005, 10:59 PM
#147
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
VB Code:
[COLOR=Yellow]Private Sub cmdsummary_Click()[/COLOR]
'Calculate the average and dispaly the totals
Dim curaveragepay As Currency
Dim strmessage As String
curaveragepay = [COLOR=DarkGreen]curpaytotal [/COLOR]/ 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"
End Sub
Is error
-
Oct 18th, 2005, 11:06 PM
#148
Re: Piecework Visual Basic 6.0
You need to impliment (add) that code to calc those prices!
-
Oct 18th, 2005, 11:13 PM
#149
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
-
Oct 18th, 2005, 11:15 PM
#150
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
-
Oct 18th, 2005, 11:16 PM
#151
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.
-
Oct 19th, 2005, 01:59 AM
#152
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
People i am in the class help me as possible
-
Oct 19th, 2005, 02:16 AM
#153
Thread Starter
Lively Member
Re: Piecework Visual Basic 6.0
-
Oct 19th, 2005, 07:30 AM
#154
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
-
Oct 19th, 2005, 07:47 AM
#155
Thread Starter
Lively Member
Re: [RESOLVED] Piecework Visual Basic 6.0
No No You Guys Don't really understand what i was saying
-
Oct 19th, 2005, 08:11 AM
#156
Thread Starter
Lively Member
Re: [RESOLVED] Piecework Visual Basic 6.0
[IMG]file:///D:/Games%20screenshots/ScreenHunter_150.bmp[/IMG]
-
Oct 19th, 2005, 08:14 AM
#157
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
-
Oct 19th, 2005, 08:24 AM
#158
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.
-
Oct 19th, 2005, 10:17 AM
#159
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|