Thank you for the replies.
I tried adding the following code:
If rs Is Nothing Then
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot, dbSeeChanges)
Else
rs.OpenRecordset strSQL, dbOpenSnapshot, dbSeeChanges
End If
But on the
rs.OpenRecordset strSQL, dbOpenSnapshot, dbSeeChanges...