Quantcast
Viewing latest article 3
Browse Latest Browse All 4

Answer by Marc B for How to use OR in IF, ELSE, THEN Condition - VB.Net

You're using OR, which means the if() test can bail out as soon as ANY of the conditions evaluate to boolean TRUE. e.g.

 FALSE or FALSE or FALSE or TRUE or FALSE .... FALSE = TRUE

If your .Text is NOT equal to "Egan Jones", then that's "true", and the rest of the statement becomes irrelevant and execution will skip straight into the 'true' clause.

You want AND instead.

TRUE and TRUE and FALSE and TRUE ... = FALSE

Viewing latest article 3
Browse Latest Browse All 4

Trending Articles