It would not work. The Glock 40 has a longer barrel. A Glock20 barrel would be too short. Also, I believe the Glock 40 has a different slide, and I do not know if the interior demensions of the G40 (gen 4) slide would be the same as the G3/g4 glock model 20