terryvanduzee
Registered User.
- Local time
- Yesterday, 20:54
- Joined
- Sep 23, 2005
- Messages
- 22
Hello
Is there a way to take an array, parse the values and then based on one value, add the corresponding values to a count for each record?
Ex:
Lets say a pizza place wants to track their toppings; which topping are chosen with each other topping.
Tomatoes, Peperoni, mushrooms, extra cheese etc.
I have a form where I would like to see a count of the number of times that mushrooms were selected when tomatoes were selected, when tomatoes were selected, how many times (for the entire database) how many times peperoni, extra cheese, ground beef etc were selected.
So in a combo box, the user would select tomatoes or mushrooms etc and the corresponding count for each other topping would populate text fields with the count of how many times each was choosen when the value in the combo box is selected.
So, lets say the user selects tomatoes.
Text boxes that represent mushrooms, ground beef, peperoni, extra cheese would display the number of times it was chosen as a topping when a person had ordered a pizza with tomatoes.
The array I was thinking of would be "peperoni, mushrooms, extra cheese, ground beef, tomatoes.
User selects Tomatoes from the combobox.
Record 1 has tomatoes, peperoni and extra cheese (no ground beef, mushrooms)
Record 2 has peperoni, tomatoes and ground beef
Record 3 has tomatoes, extra cheese.
... etc
The form would show under the heading of tomatoes 3, mushrooms 0, extra cheese 2, ground beef 1 etc
If Ground beef is selected from the combobox the form would display:
ground beef 1, tomatoes 1, extra cheese would display 0 etc.
The code would go through each value in the array and add 1 to the count where it is associated to each topping in the array. Then move on to the next record in the DB.
Any help would be appreciated.
Thank you
Terry
Is there a way to take an array, parse the values and then based on one value, add the corresponding values to a count for each record?
Ex:
Lets say a pizza place wants to track their toppings; which topping are chosen with each other topping.
Tomatoes, Peperoni, mushrooms, extra cheese etc.
I have a form where I would like to see a count of the number of times that mushrooms were selected when tomatoes were selected, when tomatoes were selected, how many times (for the entire database) how many times peperoni, extra cheese, ground beef etc were selected.
So in a combo box, the user would select tomatoes or mushrooms etc and the corresponding count for each other topping would populate text fields with the count of how many times each was choosen when the value in the combo box is selected.
So, lets say the user selects tomatoes.
Text boxes that represent mushrooms, ground beef, peperoni, extra cheese would display the number of times it was chosen as a topping when a person had ordered a pizza with tomatoes.
The array I was thinking of would be "peperoni, mushrooms, extra cheese, ground beef, tomatoes.
User selects Tomatoes from the combobox.
Record 1 has tomatoes, peperoni and extra cheese (no ground beef, mushrooms)
Record 2 has peperoni, tomatoes and ground beef
Record 3 has tomatoes, extra cheese.
... etc
The form would show under the heading of tomatoes 3, mushrooms 0, extra cheese 2, ground beef 1 etc
If Ground beef is selected from the combobox the form would display:
ground beef 1, tomatoes 1, extra cheese would display 0 etc.
The code would go through each value in the array and add 1 to the count where it is associated to each topping in the array. Then move on to the next record in the DB.
Any help would be appreciated.
Thank you
Terry