I looked at your code and made a few changes...
"Filter" and "Match" are reserved words in Access/Jet, so I changed them. Also, some of your variables were long - I shortened them.
Code:
Sub FilterWords()
Dim d As DAO.Database
Dim mm As DAO.Recordset 'mainMail
Dim ss As DAO.Recordset 'sparrSokord
Dim tt As DAO.Recordset 'testtableTestmail
Dim mainTemp As String
Dim sparrTemp As String
Dim IsMatch As Boolean
Set d = CurrentDb
Set mm = d.OpenRecordset("Main")
If mm.BOF And mm.EOF Then
msgbox "No records found for 'Main' "
mm.Close
Exit Sub
End If
mm.MoveLast
mm.MoveFirst
Set ss = d.OpenRecordset("Sparr")
If ss.BOF And ss.EOF Then
msgbox "No records found for 'Sparr' "
ss.Close
Exit Sub
End If
ss.MoveLast
ss.MoveFirst
'deletes all records from table
'comment out the following line if you do not want to delete all records
' "Testtable" before running this code.
d.Execute "DELETE * FROM Testtable"
Set tt = d.OpenRecordset("Testtable")
'start of outer loop
Do Until mm.EOF
mainTemp = mm!Mail
IsMatch = False
'move inner loop to top of recordset
ss.MoveFirst
'start of inner loop
Do Until ss.EOF
sparrTemp = ss!sparrord
If (InStr(mainTemp, sparrTemp) <> 0) Then
IsMatch = True
Exit Do
End If
ss.MoveNext
Loop
'if not found, add to test table
If (IsMatch = False) Then
tt.AddNew
tt!testMail = mainTemp
tt.Update
End If
'move outer loop to next record
mm.MoveNext
Loop
'clean up
On Error Resume Next
'close recordsets
mm.Close
ss.Close
tt.Close
'destroy objects
Set d = Nothing
Set mm = Nothing
Set ss = Nothing
Set tt = Nothing
End Sub
I don't see anything wrong with the code... let me know what happens.