Multiple Input Filter

dsahni

New Member
Hi ,

I am using Multiple Input Filter. I have 2 Inputs Queries which have 2 row CustomerRow and OrdersRow.Both the queries have one field in common CID. My output row should contain matching data from both the rows.
The Start method of Multiple Input Filter has the code

Function Start( ) As Boolean
Start = Super::Start( )
' Insert your code here
Set adapter = InputAdapters.GetAt(1)
Set CustomerRow = adapter.Fetch()

End Function

And Fetch method has the code

Function Fetch( ) As AcDataRow
Dim OrdersRow As DataRow1
Dim OrderRowMain As DataRow1
Dim adapter1 As AcDataAdapter
Set adapter1 = InputAdapters.GetAt(2)
Set OrdersRow = adapter1.Fetch( )
If CustomerRow Is Nothing Then
Exit Function
End If
While (Not CustomerRow Is Nothing)
Do While (Not OrdersRow Is Nothing)
If (CustomerRow.CID = OrdersRow.CID) Then
Dim MainRow As FinalRow
Set MainRow = New FinalRow
MainRow.CID = CustomerRow.CID
MainRow.FNAME = CustomerRow.FIRSTNAME
MainRow.LNAME = CustomerRow.LASTNAME
MainRow.OID = OrdersRow.ORDERID
MainRow.STATUS = OrdersRow.STATUS
AddRow(MainRow)
Set Fetch = MainRow
End If
Set OrdersRow = adapter1.Fetch( )
Loop
Set CustomerRow = adapter.Fetch()
Set adapter1 = New AcDataAdapter
Set adapter1 = InputAdapters.GetAt(2)
Set OrdersRow = New DataRow1
Set OrdersRow = adapter1.Fetch()
Wend
End Function

The problem with this code is that it only returns me one row ie first matching row.
I debugged the problem and concluded that "When OrdersRow once becomes Nothing , it does not get reintialized and that is cause of return on only one matching row"

Please Help ASAP.

Thanks,
D
 
Top