[RESOLVED] i need help with this program i have no clue what to do
i need to have this done in the next few hours but i have no idea how to do all these dam functions...here is what i need done
When a commission is given for a salesperson his or her percent of total sales should also be given
add a summary command button. when it is clicked, total sales, total profit, and average commission will be placed on the form. the calculate command button should be the default button. the clear command button should be the cancel button. make sure to document the project with remark statements. use the naming rules and conventions studied
Put to use the following items:
tool tips
access keys
enabled property
tab order and setting focus during execution
formatting functions
accumulators
VB Auto Center
Salespeople for the used are compensated using a commission system. the commission is based on the costs incured for the vehicle
Commission =
Commission rate X (Sales price - Cost value)
the screen will allow the user to enter the salesperson's name, the selling price of the vehicle, and the cost of the vehicle. Use a constant of 20 percent for the commission rate.
The Calculate command button will determine the commission earned by the salesperson; the Clear button will clear the text boxes. a Print Form button will be available ONLY after the calculation has been made. it will be disabled untill the Calculate button has been pressed the first time. When the Clear button is pressed, the Print Form button will become disabled.
Re: i need help with this program i have no clue what to do
Sorry we don't do people's homework on this forum.
I am sure you had more than just a "few hours" to do this project, I don't know why you waited until the last minute, however that is neither here nor there. We just don't do homework for people.
Re: i need help with this program i have no clue what to do
let me be more specific on what i need help with, i need the syntax for a command button, that when i press it the contents of a text box - the contents of another text box is multiplied by 20, and that is put into a lbl box
Re: i need help with this program i have no clue what to do
what do you have done so far? please post the code you have come up with, and I am sure people on here will be more than happy to help you.
The "problem", if you want to call it that, is people on here LOVE to help, but they don't like to do all the work for you. If you show effort being put forward, you will likely get the help you need.
Re: i need help with this program i have no clue what to do
i have the layout all my command buttons are down i have the text boxes made lbl box is made but i don't know the syntax to put on cmdCalculate so it will do lblCommission.Caption = 20% * (txtsales.Text - txtCost.txt) whats the syntax to get it to do that? is what i want to know, got the print form button working not sure about the clear button it's supposed to clear the values of the text boxes...but idk how i'll check up on that later....thats all i really don't understand for now
Edit: also clear is set as cancel button and calculate is set as default button
Last edited by Newtonx; Jan 2nd, 2007 at 02:00 PM.
Re: i need help with this program i have no clue what to do
In the form view, double click your command button to create the Command_Click event. Inside that sub, put the code for your computation. Easy as that.
Re: i need help with this program i have no clue what to do
yes but what is the syntax for the code i don't know the formatting function i have to put with it and sorry for the wrong forum, nice 127.0.0.1 ip no place like home definatly true
Re: i need help with this program i have no clue what to do
Why set it as a string? A label's Caption property understands numbers perfectly well, and you might want to keep it as a number in case you need to use it later.
Re: i need help with this program i have no clue what to do
You may also want to add some error handling incase someone enters values that are not valid to compute... like entering letters where they should enter numbers..
Re: i need help with this program i have no clue what to do
Originally Posted by kleinma
You may also want to add some error handling incase someone enters values that are not valid to compute... like entering letters where they should enter numbers..
Re: i need help with this program i have no clue what to do
Originally Posted by timeshifter
Why set it as a string? A label's Caption property understands numbers perfectly well
Because the Caption data type is a String. Casting it to a String is the correct way to do it.
TextBoxes default is .Text and you dont have to use it, but I always explicitly use Text1.Text, as in VB.Net there is no default - just good practice
Re: i need help with this program i have no clue what to do
Originally Posted by Bruce Fox
Because the Caption data type is a String. Casting it to a String is the correct way to do it.
TextBoxes default is .Text and you dont have to use it, but I always explicitly use Text1.Text, as in VB.Net there is no default - just good practice
especially if you plan to move to .NET where they have implement strict casting so you can add two numeric strings together without first casting them as numbers.
Sure you can turn option strict off, but I wouldn't recommend it.
Re: i need help with this program i have no clue what to do
Private Sub cmdCalculate_Click(Index As Integer)
lblCommision.Caption = Round(((CDbl(txtSales.Text) - CDbl(txtCost.Text)) * 0.2), 2)
End Sub
it highlights the Private Sub cmdCalculate_Click(Index As Integer) in yellow and the .Text in blue still an error..should i create a new project and try it?
Re: i need help with this program i have no clue what to do
i remade it just putting a txtCost and txtSales as text boxes, and cmdCalculate as the command button and lblCommission as the label button, still nogo
Re: i need help with this program i have no clue what to do
You're right, you did need help... and there's a good reason it won't work.
You have txtSales and txtCost as members of a control array. I'm guessing you made one text box, then copy-pasted the others to keep the size. Unfortunately, you kept the name, which made them an array, then you changed the name but they kept their status as members of an array. Delete them, make new text boxes, and don't copy-paste them. Just resize them all to where you need them, and give them the right names.
Secondly, you don't have a lblCommision. You have a lblCom. If you try to use a name that's not assigned to an object, you'll get errors since the object doesn't exist.
Re: i need help with this program i have no clue what to do
Control Arrays are handy, however in this case you may want to add a new set of 3 TextBox's
correctly named, but dont select yes when prompted to make a Control Array when 'pasting' the TextBox's.