Link to home
Start Free TrialLog in
Avatar of tesla764
tesla764

asked on

Run-time Error '13'. Type mismatch

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
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tesla764
tesla764

ASKER

Sorry I haven't responded just yet. I will soon. I have been working on other problems that have arisen.
Thanks for you patience.
Thanks, I got this worked out.