Solved

Run-time Error '13'.    Type mismatch

Posted on 2014-03-06
4
474 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using web browser with BING 40 132
TT Auto Dashboard 13 95
Set WorkSheet  not Working 9 43
VB script to continue despite error 2 16
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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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