The problem with these types of questions is that your instructor has some specific point they are trying to teach. The actual project may be built poorly, but demonstrate the technique as intended.
There is no indication of how the list of names are meant to be related to the other data. For instance, if the Workshop listbox only contains a list of workshop names, how do you know how many days the workshop is supposed to be or what its cost is?
The one thing I am sure of is that what I would suggest you do, is not what your instructor intends for you to do. Because it sounds like you need to create a Workshop class and add instances of that class to the listbox. But your course may not be at the point of writing your own classes yet...
One guess is that you are supposed to hard-code the values of the number of days and price into this If-Then statement... like I said, homework projects are usually terrible applications from a design point-of-view, but then again they are only meant to demonstrate a specific concept - and we don't know what yesterday's lecture was about! :)
If my guess is correct, then perhaps you are supposed to do something like:
| Dim workshopLength As Integer |
| Dim workshopCost As Double |
| |
| If ListBox1.SelectedIndex = 0 Then 'Set values for workshop #1 |
| workshopLength = 3 'three days |
| workshopCost = 750.0 '$750.00 for the workshop |
| ElseIf ListBox1.SelectedIndex = 1 Then 'Set values for workshop #2 |
| workshopLength = 1 |
| workshopCost = 125.0 |
| ElseIf ListBox1.SelectedIndex = 2 Then 'Continue this for each possible works |
| |
| ElseIf ListBox1.SelectedIndex = -1 Then |
| 'no workshop was selected |
| 'perhaps show a message and exit sub |
| End If |
Then after you've figured out all your variable values you can create a string that contains all the correct output information. This example only created 2 variables and apparently the assignment calls for at least 5 to hold all the required info.
Again, I'm just guessing that this is what you are supposed to do. I would suggest that you confer with fellow classmates and see what they think the instructions mean...
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"