Solved

Using if and or

Posted on 2006-10-19
2
136 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now