We help IT Professionals succeed at work.

Using if and or

isnoend2001
isnoend2001 used Ask the Experts™
on
Hi experts
Seems like i have used this before
If txtTaxRate <> 0 Or txtTaxRate <> "" Then
I am getting: "Argument not opional" error
Am i missing something?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Technology and Business Process Advisor
Most Valuable Expert 2013
Commented:
What kind of variable is that?  Integer?  Single?  Double?  String?

Your if statement is treating it as BOTH a numeric value and a string value - you can't do that.

If String, then use this:
If txtTaxRate <> "0" Or txtTaxRate <> "" Then

If Numeric, then I'd do this:
If IsNumeric(txtTaxRate) = False Or txtTaxRate = 0 Then

Author

Commented:
Thanks leew
Somehow txtTaxRate had an index  txtTaxRate(64)