Solved

Instr Type Mismatch

Posted on 2009-03-31
10
487 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
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24030876

try this

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

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24030884
or

try this

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

Expert Comment

by:TextReport
ID: 24030902
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 24030908
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
ID: 24030946
Sorry...  I always include the start in my syntax, but double-checking the Help file - it is optional, defaulting to 1.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24030966


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

Expert Comment

by:mbizup
ID: 24030983
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
ID: 24030998
Thx, Rey... very slow connection today :)
0
 
LVL 28

Expert Comment

by:TextReport
ID: 24031056
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
ID: 24031270
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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