Editing scores

I am trying to change the key signature in a score half way through the piece - how can I do this ? Even when I select a particular bar, it changes the key signature of the whole piece.