have you tried doing select distinct.

you also want
On Error GoTo Transerror

above the move first because if no records are returned, then an error will occur on movefirst.