Announcement

Collapse
No announcement yet.

Visual Basic help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Visual Basic help

    I have a program all i need to do is fix the last part, I keep getting an end of statment error and cant figure out how to fix it, and snytax error *

    Private Sub CalcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcButton.Click
    'Select Case True
    'This adds
    Dim strChoice As String
    strChoice = OperationGroupBox.Text
    Select Case True
    'AnswerLabel.Text = Val(UnitsTextBox.Text) * 10
    Case RetailerRadio.Checked

    if val(UnitsTextBox.text < 3 Then
    UnitsTextBox.Text = 5 * Val(9) Then
    else if
    val(UnitsTextBox.text) > 8 then
    *14
    Elseif
    val (UnitsTextBox.text) > 9 then
    * 12

    Case WholesalerRadio.Checked
    If Val(UnitsTextBox.Text) < 4 Then
    * 10
    elseif
    val(UnitsTextBox.text) >5 then
    * 9
    End If
    End Select
    End Sub

    "Real intelligence is like a river; the deeper it is, the less noise it makes.”

    Click Me


    #2
    Originally posted by NorcoAccord
    I have a program all i need to do is fix the last part, I keep getting an end of statment error and cant figure out how to fix it, and snytax error *

    Private Sub CalcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcButton.Click
    'Select Case True
    'This adds
    Dim strChoice As String
    strChoice = OperationGroupBox.Text
    Select Case True
    'AnswerLabel.Text = Val(UnitsTextBox.Text) * 10
    Case RetailerRadio.Checked

    Code:
    if val(UnitsTextBox.text < 3 Then
    UnitsTextBox.Text = 5 * Val(9) Then

    You have too many then's and not enough if's.

    Change that around and see if it fixes it.
    Originally posted by sweet91accord
    if aredy time i need to put something in cb7tuner. you guy need to me a smart ass about and bust on my spelling,gramar and shit like that in so sorry.

    Comment


      #3
      Aside from that, your missing a closing ')' on that same line.

      try and use the [ code ] [ /code ] tags next time. it makes it easier to read.

      Owner of https://theclunkerjunker.com

      Comment


        #4
        Still not getting it I cut out a lot of the code if i can get one peice to work here is what I have done
        Code:
          Private Sub CalcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalcButton.Click
                'Select Case True
                'This adds
                Dim strChoice As String
                strChoice = OperationGroupBox.Text
                Select Case True
                    'AnswerLabel.Text = Val(UnitsTextBox.Text) * 10
                    Case RetailerRadio.Checked
        
                        If AnswerLabel.Text = Val(UnitsTextBox.Text) < 3 Then *15
        
        
        
                End Select
            End Sub
        End Class

        "Real intelligence is like a river; the deeper it is, the less noise it makes.”

        Click Me

        Comment


          #5
          can you post the exact compiler errors.

          OT: God i hate Visual Basic.

          Owner of https://theclunkerjunker.com

          Comment


            #6
            I get a snytax error If AnswerLabel.Text = Val(UnitsTextBox.Text) < 3 Then *15 right at the time symbol

            "Real intelligence is like a river; the deeper it is, the less noise it makes.”

            Click Me

            Comment


              #7
              Need to move that down to the next line to do your logic operations. Nothing should follow the "Then"

              i.e.

              If AnswerLabel.Text = Val(UnitsTextBox.Text) < 3 Then
              AnswerLabel.Text = Val(UnitsTextBox.Text) *15 (or whatever operation you are doing).
              else if
              blah blah blah
              Originally posted by sweet91accord
              if aredy time i need to put something in cb7tuner. you guy need to me a smart ass about and bust on my spelling,gramar and shit like that in so sorry.

              Comment

              Working...
              X