Solved

Using if and or

Posted on 2006-10-19
2
139 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

732 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