Quantcast
Channel: "And" and "Or" troubles within an IF statement - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by assylias for "And" and "Or" troubles within an IF statement

This is not an answer, but too long for a comment. In reply to JP's answers / comments, I have run the following test to compare the performance of the 2 methods. The Profiler object is a custom class...

View Article



Answer by JimmyPena for "And" and "Or" troubles within an IF statement

I like assylias' answer, however I would refactor it as follows:Sub test()Dim origNum As StringDim creditOrDebit As StringorigNum = "30062600006"creditOrDebit = "D"If creditOrDebit = "D" Then If...

View Article

Answer by assylias for "And" and "Or" troubles within an IF statement

The problem is probably somewhere else. Try this code for example:Sub test() origNum = "006260006" creditOrDebit = "D" If (origNum = "006260006" Or origNum = "30062600006") And creditOrDebit = "D" Then...

View Article

"And" and "Or" troubles within an IF statement

I'm trying to use "And"& "Or" within an If statement. I probably have my syntax wrong.the result comes back false when the data should make it true. Here is the code:ElseIf (origNum = "006260006"...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>