Hi guys, basically im writing a program where the user inputs the number of coffees they require from a number of drop down boxes, one for cappucino, espresso, iced coffee and latte. after this, there is a 'calculate' button which totals these up and displays them in a textbox.

my problem is (mostly cos im a vb novice) is that i also need to be able to count up the number of coffees selected over the use of the program, and to be able to average them out. these need to be displayed in a text box an another form.

basically so far, i have created variables in the drop down boxes.
anslatt = Val(Combolatt.Text) * 1.85 etc.

then added these up
bftakeaway = anscapp + ansespr + ansiced + anslatt
AnswerBox1.Text = bftakeaway


simple i know, but its the best i could do haha!

anyway thanks so much for reading and any help would be really appreciated!

Post some more of your code.

Provide the data types of the variables.

Don't use Help as a subject Matter.

Peace.

Yeah sorry i wasnt very clear there! basically:

anslatt, anscapp,ansespr and ansiced are the variables (as double) which i have used to represent the number a user selects from a combo box.

once a user has selected the amount required, they press the 'calculate' button which adds the values of each combo box i.e the variables anslatt, anscapp and so on. the end figure (bftakeaway) is then displayed in AnswerBox1.


my problem is i now need a way of storing the amount of cappucinos, espressos, lattes and so on, so that I can display the amount which has been selected over the course of the day., and not just the total selected on each order.

i was thinking perhaps an xml file or array? anyway im very lost and any help would be great!

and sorry about that, bit of a noob to forums!

Hmm,

Look into Database.

If you are just practicing it may be a good idea to play with MS Access, If you don't mind getting right into it look into SQL.

Here Read these

Database.

SQL. This is a good beginners guide.

Just read these and tell me what you think.

Present your Questions and Theories.

Peace.

This article has been dead for over six months. Start a new discussion instead.