Goal-directed behavior requires flexibility, the ability to adjust behavior in response to changing environmental circumstances. This flexibility is mediated by the prefrontal cortex and striatum of the brain and is strongly influenced by neurotransmitter dopamine, which modulates the balance between persistence and shifting of behavioral strategies. Here, we investigated behavioral flexibility in genetically modified mice, NR1DATCreERT2 and NR1D1CreERT2, lacking functional NMDA receptors in dopaminergic and dopaminoceptive (D1 expressing) neurons, respectively. We used a T-maze based task, which permits to examine the ability to learn and switch between two spatial maze tasks requiring different response strategies. In a visual cue task, mice had to make a turn toward the arm of the maze where the visual cue was placed to obtain food reward. After the switch to response direction task, animals had to make a turn based on direction (left or right, regardless of the visual cue). Loss of NMDA receptors in dopamine but not D1 expressing neurons disrupted shifting between strategies. Furthermore, analysis of arm choice errors revealed that the deficit was not due to perseveration of a strategy previously learned but due to impairments in acquisition of a new strategy. Supported by the grant OPUS 2011/03/B/NZ4/02211