Results 1 to 13 of 13

Thread: None of my If statements are executing.

Threaded View

  1. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: None of my If statements are executing.

    This would be better but still would not work as expected
    Code:
            Dim Number As Integer
            Dim Display As String        
            Display = lblDisplay.Text
    
            If IsNumeric(txtNumber.Text) = True Then
                Number = Val(txtNumber.Text)
                If Number < 1 Or Number > 100 Then
                    If Number > 100 Then
                        Display = " The Number You entered is too high"
                    ElseIf Number < 1 Then
                        Display = " The Number You entered is too low"
                    ElseIf Number >= 1 And Number <= 100 Then
                        Process1.Enabled = False
                    End If
                Else
                    Display = " The number you entered is not between 1 and 100"
                End If
            Else
                Display = " You did not enter a numerical value "
            End If
    Last edited by DataMiser; Jun 22nd, 2012 at 05:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width