Put a Debug.Print SQL above the Set rec. Then you can copy and paste the SQL string into a query to make sure the query is working correctly.