Solved

Instr Type Mismatch

Posted on 2009-03-31
10
483 Views
Last Modified: 2013-11-27



I'm getting a type mismatch when I add the textual comparison switch to the following

InStr(rsCol("Client Name"), (vArr(j)), 1)

The values are:ClientName:Autauga County Treasurer
SearchTerm:ALABAMA
0
Comment
Question by:keschuster
  • 5
  • 3
  • 2
10 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility

try this

InStr(rsCol("Client Name"), vArr(j))
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
or

try this

InStr(rsCol("[Client Name]"), vArr(j))
0
 
LVL 28

Expert Comment

by:TextReport
Comment Utility
The syntax InStr(rsCol("Client Name"), (vArr(j)), 1) looks correct but what are you doing with it, you need to provide the full line of code includinmg the value of J and the value of vArr(j)

If you Debug.Print InStr(rsCol("Client Name"), (vArr(j)), 1) do you get the error?

Cheers, Andrew
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
Comment Utility
You need to specify the "Start" for the comparison:

InStr(1, rsCol("Client Name"), (vArr(j)), 1)  '<--- to start at the first character
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Sorry...  I always include the start in my syntax, but double-checking the Help file - it is optional, defaulting to 1.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility


yes you are correct miriam,
if the Compare is use, you have to specify the start argument
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Take three (and sorry for all the posts)

From VBA Help:
"The start argument is required if compare is specified."

So it sounds like you DO need the start parameter if you are specifying Text Compare.
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Thx, Rey... very slow connection today :)
0
 
LVL 28

Expert Comment

by:TextReport
Comment Utility
Hi Miriam, new one on me, shows how ofter I use anything other than the default comparison, that will be never then.
Cheers, Andrew
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Andrew,

<shows how ofter I use anything other than the default comparison>

Lol!  I never use anything else either :-)

I don't know how/why I picked up the habit of using the Start parameter.  I always assumed it was required.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now