I have a class with a function accepting a recordset as a parameter. I'm specifying 'ADODB' in both the declarations and the parameters. Though I'm not sure why it would matter being as though I don't even have the DAO library referenced. I've compacted and repaired, tried ByVal and ByRef Parameters, with and without parenthesis; I'm spent on it. I had the exact same problem when trying to call a different method accepting a recordset as a parameter in the line of code above it. In that case I removed the parenthesis and there weren't any other issues. Regardless of everything said, I still can't get past the RTE: 13. I've posted the code below... can anyone help?
MyModule:
[vb]
Public Sub MySub()
Dim Conn As ADODB.Connection
Dim strFittingSQL As String
Dim rsFittings As ADODB.Recordset
Dim MyRsChecker As clsRecordsetEvaluator
Dim blnFittingsCorrect As Boolean
Dim blnStraightChannelCorrect As Boolean
Set Conn = CurrentProject.Connection
Set rsFittings = New ADODB.Recordset
Set MyRsChecker = New clsRecordsetEvaluator
strFittingSQL = "Select MY_TABLE.* From MY_TABLE Where Instr(MY_TABLE.FITTING_TYPE,'COVER')=0 and " & _
"Instr(MY_TABLE.FITTING_TYPE,'STRAIGHT')=0"
With rsFittings
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strFittingSQL, Conn
End With
blnStraightChannelCorrect = MyRsChecker.CheckStraightChannel rsStraightChan
'Here is where I receive RTE 13
blnFittingsCorrect = MyRsChecker.CheckChannelFittings rsFittings
MsgBox "Finished"
End Sub
[/vb]
MyClassModule:
[vb]
Function CheckChannelFittings(rsFittingCollection As ADODB.Recordset) As Boolean
'My Code in here
End Function
[/vb]
I can't see the error, thank you in advance.
-ReadyToKickSomething
MyModule:
[vb]
Public Sub MySub()
Dim Conn As ADODB.Connection
Dim strFittingSQL As String
Dim rsFittings As ADODB.Recordset
Dim MyRsChecker As clsRecordsetEvaluator
Dim blnFittingsCorrect As Boolean
Dim blnStraightChannelCorrect As Boolean
Set Conn = CurrentProject.Connection
Set rsFittings = New ADODB.Recordset
Set MyRsChecker = New clsRecordsetEvaluator
strFittingSQL = "Select MY_TABLE.* From MY_TABLE Where Instr(MY_TABLE.FITTING_TYPE,'COVER')=0 and " & _
"Instr(MY_TABLE.FITTING_TYPE,'STRAIGHT')=0"
With rsFittings
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strFittingSQL, Conn
End With
blnStraightChannelCorrect = MyRsChecker.CheckStraightChannel rsStraightChan
'Here is where I receive RTE 13
blnFittingsCorrect = MyRsChecker.CheckChannelFittings rsFittings
MsgBox "Finished"
End Sub
[/vb]
MyClassModule:
[vb]
Function CheckChannelFittings(rsFittingCollection As ADODB.Recordset) As Boolean
'My Code in here
End Function
[/vb]
I can't see the error, thank you in advance.
-ReadyToKickSomething