I imagine you're following Actuate's example report then, since you're using iterator? I rarely, if ever, use the iterator methodology when using the MIF.
This is what my Fetch of the MIF looks like:
Function Fetch( ) As AcDataRow
'Set Fetch = Super::Fetch( )
' Insert your code here
' Declare rows to manipulate data
Dim row1 As dr1 'your first datarow name
Dim row2 As dr2 'your second datarow name
Dim aRow As drMIF 'the merged row
' Declare adapters for each query
Dim Adapt1 As ds1 'your first data source name
Dim Adapt2 As ds2 'your second data source name
' If we are at the beginning, prepare the adapters
If Adapt1 Is Nothing Then
Set Adapt1 = InputAdapters.GetAt(1)
End If
If Adapt2 Is Nothing Then
Set Adapt2 = InputAdapters.GetAt(2)
End If
' Fetch data for each row
Set row1 = Adapt1.Fetch()
Set row2 = Adapt2.Fetch()
If row1 Is Nothing and row2 Is Nothing Then
Exit function
End If
' Get the data from the first query to the MIF row
If Not row1 is Nothing Then
aRow.CoName = row1.GetValue("companyName")
.
.
.'do for all fields of the first data source
' Get the data from the second query to the MIF row
If Not row2 is Nothing Then
aRow.Name1 = row2.GetValue("Name1")
.
.
.'do for all fields of the second data source
Set Fetch = aRow
End Function
Then, if you need more complex logic, build it in. It gets more complex when you need to match the two rows based on some field's value, or if you need to eliminate duplicate records; then you have to have a static SavedDataRow to hold the record to compare against.
Hope this helps.
Bill