![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2004
Posts: 6
Rep Power: 0
![]() |
A user is required to select an activity from a combo box, then type in a number of hours in a text box, and then click add. The activity is inserted into the activity listbox, and the hours into the hours listbox. I have code that totals all the hours in the listbox, this works fine. But now I need to add all the hours that I have for particular activites. For example, if i have the following
Activity Hours Analysis 4 Design 2 Implementation 2 Design 3 Analysis 2 Documentation 5 Design 3 Now I want to add the total number of hours where the activity is say analysis and documentation and put the result in a label. Therefore ignoring the hours that are not those particular activities |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Sep 2004
Location: South Africa, Eastern Cape
Posts: 28
Rep Power: 0
![]() |
Just iterate through the list as you normally would. The only difference is iterate through the activity list. Using a simple if statement, check if it matches any of your criterion. If it does get the value out of the other list using the same index. Just add these. If it doesn't match don't add it to your total.
This is rather simple, so are you just looking for someone to code for you or did you genuinely not know?
__________________
Be vewwy vewwy quiet. I'm hunting wuntime ewwors. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|