Solved

Using if and or

Posted on 2006-10-19
2
137 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:isnoend2001
2 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 50 total points
ID: 17771149
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
0
 

Author Comment

by:isnoend2001
ID: 17771199
Thanks leew
Somehow txtTaxRate had an index  txtTaxRate(64)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question