Solved

Run-time Error '13'.    Type mismatch

Posted on 2014-03-06
4
480 Views
Last Modified: 2014-03-11
I also attached a Screen Shot file
Any ideas on what could be causing this error?

When running this code the following line causes an error...
.Parameters.Append .CreateParameter("ifo_area_cat", adBigInt, adParamInput, , CLng(Trim(parasplit(4))))

Open in new window

Error - Run-time Error '13'.    Type mismatch

Debugger points to...
.Parameters.Append .CreateParameter("ifo_area_cat", adBigInt, adParamInput, , CLng(Trim(parasplit(4))))

Open in new window


Code...
Public Function SetReportData(ByRef objReport As Report, strReportName As String, intConnectionType As Long, Optional strFilter As String = "", Optional strOrder As String = "", Optional strParameter As 

String = "", Optional intRecordSets As Long = 1, Optional strSubReportNames As String = "", Optional blnNoCopy As Boolean = True, Optional ByRef rsDataSource As ADODB.Recordset) As Boolean



Case "CycleCountReport"
            With cmd
                .Parameters.Append .CreateParameter("iStartDate", adDate, adParamInput, , CDate(Trim(parasplit(0))))
                .Parameters.Append .CreateParameter("iEndDate", adDate, adParamInput, , CDate(Trim(parasplit(1))))
                .Parameters.Append .CreateParameter("iCompanyID", adBigInt, adParamInput, , CLng(Trim(parasplit(2))))
                .Parameters.Append .CreateParameter("iBuilding", adBigInt, adParamInput, , CLng(Trim(parasplit(3))))
                .Parameters.Append .CreateParameter("ifo_area_cat", adBigInt, adParamInput, , CLng(Trim(parasplit(4))))
                .Parameters.Append .CreateParameter("iAisleString", adVarChar, adParamInput, 1000, Trim(parasplit(5)))
                .Parameters.Append .CreateParameter("iVariancesOnly", adTinyInt, adParamInput, , CInt(parasplit(6)))
            End With
            
            SQLstr = "spITS_CycleCountReport"

Open in new window

2855--Debugger-Screen-Shot.JPG
0
Comment
Question by:tesla764
[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
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39909769
Indicates you're passing a string (non numerical) when a number is expected.
Whats the source of parasplit
0
 

Author Comment

by:tesla764
ID: 39913617
Sorry I haven't responded just yet. I will soon. I have been working on other problems that have arisen.
Thanks for you patience.
0
 

Author Closing Comment

by:tesla764
ID: 39921825
Thanks, I got this worked out.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

689 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