Hello. this is my 3rd post about the same project in one day anyways, I have a program which i have made for a term project that is due Tuesday January 23rd :S

The program is based on the game show "Deal or No Deal". As some of you may be aware the game show consists of 26 cases with different values in each case ranging from 0.01 to 1 million dollars. I am currently working on perfecting my randomization function on another forum ( randomizing array WITHOUT REPEAT) as well as another forum involving the user selecting
their case (if statement dilemma involving command buttons). Now there is only two main thing for me to cover. And they are the rounds of the game (Module counter) and generating an offer (calculating between forms)

For the purpose of my program i need to use a module to keep count of the rounds of my game. As many of you may have seen on the gameshow, "Deal or No Deal" the game is split up into rounds.

they operate as follows in this chart
Round Setup
round 1 = 6 cases are opened and then offer is generated
round 2 = 5 cases are opened and then offer is generated
round 3 = 4 cases are opened and then offer is generated
round 4 = 3 Cases are opened and then offer is generated
round 5 = 2 cases are opened and then offer is generated
round 6 = 1 case is opened and then offer is generated
round 7= 1 case is opened and then offer is generated
round 8 = 1 case is opened and then offer is generated
round 9 = 1 case is opened and then offer is generated
round 10 = User allowed to swap their case with remaining case

What i need to do, is every time a case is chosen (case command button is clicked) a count is added to the module counter. When the counter reaches 6
the user is shown their offer, and if they accept the game is over, if not they continue. now they choose 5 cases at the end of which they are prompted again with another offer, and this process continues according to the Round Setup i posted above.


On another note i need to generate an offer. The calculations to formulate the offer is simple, coding it is the hard part. All you do is start off with the combined total of all the case values together ( $3,418,416.01) and as you open the cases you subtract the value of each case from the overall total. When it comes time to generate an offer (after opening 6 cases for instance) The new total ( $3,418,416.01 - values of all cases chosen to that point) is then divided by the number of remaining cases left in play. If the user denies the offer, the number is set back to before it was divided, and the subtraction of cases continues until the next round is over (5 cases chosen). The new total after round 2 is then divided by the remaining number of cases. This cycle continues until the user either excepts the offer, ending the game, or takes their case. Now that you understand the formula of generating an offer let me now briefly explain how i need it to work.

When a case command is clicked it opens up a "Caseval" form that displays a randomized value for that case in a text box. (the value of the case was pre- determined when the form loads and the command button merely makes "Caseval" visible and it's form "Formcases" invisible) What i need to do is subtract this randomized value from the overall value. The overall value ($3,418,416.01) is stored in a text box in the form "Calculator". Then display the answer in a text box on the form "Money" .Within the Money form i would divide the value of the textbox by the remaining number of cases. obviously for the program to subtract values it has to recognize the characters as numerical values so i would string them as values in my module "DealGenerator"

My project is too big to zip to the forum (contains bitmaps) but here is some of the code if generated so far.

This is code from my opening form that contains all my cases

VB Code:
  1. Private Sub Case1_Click() ' this code is the same for all 26 cases
  2. Formcases.Visible= False  
  3. Caseval.Visible = True          '  where i add one to counter (not sure how)
  4. Case1.Visible = true
  5.  
  6.  
  7. Private Sub Form_Activate()  ' random function (working on abolishing repeats)
  8. Dim Mnyval(25) As String
  9.     Dim CaseCollection As New Collection
  10.     Dim intRand As Integer
  11.     Mnyval(0) = "0.01"
  12.     Mnyval(1) = "1"
  13.     Mnyval(2) = "5"
  14.     Mnyval(3) = "10"
  15.     Mnyval(4) = "25"
  16.     Mnyval(5) = "50"
  17.     Mnyval(6) = "75"
  18.     Mnyval(7) = "100"
  19.     Mnyval(8) = "200"
  20.     Mnyval(9) = "300"
  21.     Mnyval(10) = "400"
  22.     Mnyval(11) = "500"
  23.     Mnyval(12) = "750"
  24.     Mnyval(13) = "1000"
  25.     Mnyval(14) = "5000"
  26.     Mnyval(15) = "10000"
  27.     Mnyval(16) = "25000"
  28.     Mnyval(17) = "50000"
  29.     Mnyval(18) = "75000"
  30.     Mnyval(19) = "100000"
  31.     Mnyval(20) = "200000"
  32.     Mnyval(21) = "300000"
  33.     Mnyval(22) = "400000"
  34.     Mnyval(23) = "500000"
  35.     Mnyval(24) = "750000"
  36.     Mnyval(25) = "1000000"
  37.  
  38.    
  39.     On Error Resume Next
  40.  
  41.    
  42.     Randomize
  43.     Do Until CaseCollection.Count = UBound(Mnyval) + 1
  44.         intRand = Int(Rnd * (UBound(Mnyval) + 1))
  45.         CaseCollection.Add Item:=CStr(intRand), Key:=CStr(intRand)
  46.     Loop
  47.    
  48.     For intRand = 1 To CaseCollection.Count
  49.         Caseval.Text1.Text = Mnyval(CaseCollection.Item(intRand))
  50.     Next
  51.  
  52. End Sub



This is code from my Caseval form where all the randomized values are displayed.

VB Code:
  1. Dim cnt As Integer
  2.  
  3. Private Sub CmdOK_Click()
  4.  
  5. Scoreboard.Visible = True
  6. Caseval.Visible = False
  7. Scoretime.Enabled = True
  8. cnt = 0
  9. If Text1.Text = "0.01" Then
  10. Scoreboard.Label1.BackStyle = Transparent
  11. ElseIf Text1.Text = "1" Then
  12. Scoreboard.Label2.BackStyle = Transparent
  13. ElseIf Text1.Text = "5" Then
  14. Scoreboard.Label3.BackStyle = Transparent
  15. ElseIf Text1.Text = "10" Then
  16. Scoreboard.Label4.BackStyle = Transparent
  17. ElseIf Text1.Text = "25" Then
  18. Scoreboard.Label5.BackStyle = Transparent
  19. ElseIf Text1.Text = "50" Then
  20. Scoreboard.Label6.BackStyle = Transparent
  21. ElseIf Text1.Text = "75" Then
  22. Scoreboard.Label7.BackStyle = Transparent
  23. ElseIf Text1.Text = "100" Then
  24. Scoreboard.Label8.BackStyle = Transparent
  25. ElseIf Text1.Text = "200" Then
  26. Scoreboard.Label9.BackStyle = Transparent
  27. ElseIf Text1.Text = "300" Then
  28. Scoreboard.Label10.BackStyle = Transparent
  29. ElseIf Text1.Text = "400" Then
  30. Scoreboard.Label11.BackStyle = Transparent
  31. ElseIf Text1.Text = "500" Then
  32. Scoreboard.Label12.BackStyle = Transparent
  33. ElseIf Text1.Text = "750" Then
  34. Scoreboard.Label13.BackStyle = Transparent
  35. ElseIf Text1.Text = "1000" Then
  36. Scoreboard.Label14.BackStyle = Transparent
  37. ElseIf Text1.Text = "5000" Then
  38. Scoreboard.Label15.BackStyle = Transparent
  39. ElseIf Text1.Text = "10000" Then
  40. Scoreboard.Label16.BackStyle = Transparent
  41. ElseIf Text1.Text = "25000" Then
  42. Scoreboard.Label17.BackStyle = Transparent
  43. ElseIf Text1.Text = "50000" Then
  44. Scoreboard.Label18.BackStyle = Transparent
  45. ElseIf Text1.Text = "75000" Then
  46. Scoreboard.Label19.BackStyle = Transparent
  47. ElseIf Text1.Text = "100000" Then
  48. Scoreboard.Label20.BackStyle = Transparent
  49. ElseIf Text1.Text = "200000" Then
  50. Scoreboard.Label21.BackStyle = Transparent
  51. ElseIf Text1.Text = "300000" Then
  52. Scoreboard.Label22.BackStyle = Transparent
  53. ElseIf Text1.Text = "400000" Then
  54. Scoreboard.Label23.BackStyle = Transparent
  55. ElseIf Text1.Text = "500000" Then
  56. Scoreboard.Label24.BackStyle = Transparent
  57. ElseIf Text1.Text = "750000" Then
  58. Scoreboard.Label25.BackStyle = Transparent
  59. ElseIf Text1.Text = "1000000" Then
  60. Scoreboard.Label26.BackStyle = Transparent
  61. End If
  62.  
  63.  
  64. End Sub
  65.  
  66. Private Sub Form_Load()
  67. Scoretime.Enabled = False
  68.  
  69.  
  70. End Sub
  71.  
  72. Private Sub Scoretime_Timer()
  73. cnt = cnt + 1
  74. If cnt = 1 Then
  75. Scoreboard.Visible = False
  76. FormCases.Visible = True
  77.  
  78. End If
  79. End Sub
  80. End Sub




This is the module code i have created so far, however it doesn't seem to work


VB Code:
  1. Dim z As Double, s As Double, r As Double
  2.  
  3. Public Sub Offercalc()
  4.  
  5.     z = Val(Calculator.Calc.Text)
  6.     Calculator.Calc.Text = Str(z)
  7.    
  8.     r = Val(Money.Offer.Text)
  9.     Money.Offer.Text = Str(r)
  10.    
  11.     s = Var(Caseval.Text1.Text)
  12.     Caseval.Text1.Text = Str(s)
  13. r = z - s
  14. Money.Offer.Text = r
  15. End Sub


First off, Thanks even for reading all of this. Secondly i know its alot to take in but i need as much input as i can get for this term project as it is worth a HUGE portion of my mark and it is due on TUESDAY JAN 23

please dont take me as being a procrastinator who calls for help when they are rushing to finish. I have spent a huge amount of time just figuring out the complex vb script to write this program, seeing as i am learning Vb script for the first time this year in school. HELP is MUCH appreciated. Thank you all