In TWOK, after Terrell committed suicide in the Genesis cave, after they all beamed up, after being in Sick Bay, Chekov came to the bridge and volunteered his services. Kirk told him to take the weapons station. He must have still had command codes or whatever.
Well, I don't know that one needs specific command codes to use a station that's already in use. Codes are typically needed to release a computer lock-out (as seen in TNG and beyond). Having said that, it's not clear how many command codes each officer has or what they're for. It's possible that an officer has the option of keeping his command codes for a specific vessel stored in the ship's computer after he leaves in case he were to serve aboard the vessel again in some capacity. It's sort of like keeping an email address even after leaving a job or a school, as some places will allow you to keep your username and password.
It's not clear why Chekov was chosen for something that Sulu could easily have done himself. Sulu took over the captain's chair while Kirk was in his quarters at the outset of TSFS, but that may have been because Chekov was already in the midst of a pre-approach scan at the science station.