How To Recode A Door Lock

I have a car where the driver door will lock with the key, but not by locking it and holding the handle, and it will open with the handle when locked. Is this the solution?

I would say that your latch might be to blame. In my newport I have to use the key to lock it but in my scamp I can lock it then close the door. Maybe someone put the wrong latch inside? or hooked it up wrong?