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
Printable View
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
What are:
Mcurpaytotal and MinemployeeCount?
Where do they get their values?
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
errr...well:
u have missed of the letter t.VB Code:
Dim MinemployeeCount As Integer
You have the start of a button click event with no End Sub
You are using END!
Instead of END use:
VB Code:
Unload me
Woka
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.
Thats correct now what should i do then ?
Today is my due date for my Homework
Dim MinemployeeCount As Integer
I Have mised the t ? so where should i put it ?
Hello I am stuck in here Today is my due date for my project
Help me
Outstanding assistance Hack :thumb:.
Ahemmmm Need Help over here
Time to Panic Panic In a few hours
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!
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
Hello word it the simplest but now i am stuck at this one
Private Sub cmdsummary_Click()
'Calculate the average and dispaly the totals
Dim curaveragepay As Currency
Dim strmessage As String
Error
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
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)
View Post 136 & 138 Those are the error
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
Sorry, is that a question?Quote:
Originally Posted by Franklin67
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]
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?
what i meant was check each line to see wheather i got the statements correct
Is that simple
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.
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
You need to impliment (add) that code to calc those prices!
How do i do that
Show Me
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.
People i am in the class help me as possible
Before I hand this over
@ everyone else: That's what happens when you DON'T make an effort :D
Let it be a lesson to all ;)
No No You Guys Don't really understand what i was saying
[IMG]file:///D:/Games%20screenshots/ScreenHunter_150.bmp[/IMG]
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
*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.
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