Did you open the recorsdset before updating it?
And, please, use Code tags while posting code snippets! See Announcement: Before you post....