Hi all, new to this and hope someone can help

I have a 2006 ML320 cdi with 52,000 on it, my issue is the remote locking all works fine until you unlock get in and start the car then you can hear "clicking" from door solonoids, pull away and all door lock as they should, at any time they will unlock all by themselves! The drivers door "lock and unlock" button does nothing. If you re lock using passenger button it may last an hour or 5 mins before it all un locks again! The drivers door lock and unlock buttons do work sometimes but not often. Once the doors open whilst driving can hear the "clicking" again until you re lock. Driving me mad