Solved

Run-time Error '13'.    Type mismatch

Posted on 2014-03-06
4
464 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
Comment Utility
Indicates you're passing a string (non numerical) when a number is expected.
Whats the source of parasplit
0
 

Author Comment

by:tesla764
Comment Utility
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
Comment Utility
Thanks, I got this worked out.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 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