Make sure you know whether or not the code is Action Replay or Codebreaker and select the correct one. Also make sure the version of the codes match the version of the ROM you're playing. If it still doesn't work, then you probably have some faulty codes.
Also, since you are playing GBA games, I suggest you use VisualBoy Advance emulator instead, as it might have better cheat support.