Which line is higlighted in the debugger (you do not show the whole code)?
How did you declare your recordset, the type 13 mismatch is to my knowledge a result of mixing ADO and DAO.
You need to declare your recordset explicit like:
Dim RS as DAO.Recordset '(or ADODB.Recordset)