If Statement condition not matching up

I declare my indvalue however if my value has a valid value of say 2300 it will still go into the _badresponse = true

Why is this?
Public indvalue As Integer
 If indvalue = 0 Or 6912 Then
                _BadResponse = True
                Exit Sub
            End If

Open in new window

cmdolcetAsked:
Who is Participating?
 
Jorge PaulinoIT Pro/DeveloperCommented:
Opps!
 If indvalue = 0 Or indvalue = 2300 Then
       _BadResponse = True
       Exit Sub
 End If

Open in new window

0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Try this way:
 If indvalue = 0 Or indvalue = 6912 Then
       _BadResponse = True
       Exit Sub
 End If

Open in new window

0
 
cmdolcetAuthor Commented:
your solution is confusing. I want it to omit that loop if its anything but 0 or 6912......if the reading is 2300 its a good reading....but for whatever reason it enters the current loop i have built
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
If you want to end the loop in a value (indvalue) is 0 or 6912  then my first post is ok.
0
 
AbhishekoopsCommented:
If indvalue = 0 Or indvalue = 6912 Then
       _BadResponse = True
       Exit Sub
 End If
this wud solve your problem but even if this does clear it then fix a break point and go for step by step debugging and check the values in the Locals window or in the Immediate window.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.