GAH!!!! I know how you feel! I had this problem all last year. I would hit 2 or 3 good shots at the range and then everything after that was sh@nk city. I couldnt even chip it 10 yards!! It was all mental, honestly, as I was playing to my normal 90ish strokes on the courses.
I signed up for an emergency lesson after one horrible range session. Explained to the instructor what was happening. She asked me to chip it and show her what was wrong. NO SH@NK. Ok, then, 40 yard pitch. NO SH@NK. Alright, well it will happen on my full swing. Whadya know, no sh@nk! I clearly remember her saying "Cmon Ken! There's nothing wring with you!! Stop waiting to mess up!"
So far, so good this year. Only been to the range 3 or 4 times though, but each has been alright for me. Pre-shot routine before every shot, target in mind, etc. Each swing means something. Before, I was focused too much on NOT messing up.