title: For next loop multiplying numbers
body: <p>I am attempting to create a calculator where a user inputs a number (1-20) and it gives the user the option to get the sum or product from 1 to the number they entered. ie the sum of 5 would be 15 while the product would be 120. I am using select case and a for next loop. I have managed to get the sum portion of the calculator working correctly and thought I could use the same principle for the product portion but I am having no such luck. Any help or a gentle nudge in the right direction would greatly appreciated.
  Cheers. </p>
  
  <p>Code:</p>
  
  <pre><code>    Dim intsum As Integer
      Dim intnum As Integer
      Dim intproduct As Integer
  
      If IsNumeric(txtinput.Text) Then
          intnum = CInt(txtinput.Text)
      Else
          MessageBox.Show("Please enter a numeric value", "Input error")
          txtinput.Clear()
          txtinput.Focus()
  
      End If
  
      If intnum &gt;= 1 AndAlso intnum &lt;= 20 Then
  
          Select Case True
  
              Case btnproduct.Checked
                  For P = 1 To intnum Step 1
                      intproduct = intproduct * P
  
                  Next
  
  
              Case btnsum.Checked
                  For S = 1 To intnum Step 1
                      intsum = intsum + S
                  Next
  
  
  
  
          End Select
  </code></pre>