Your description is not very specific of conditions. Do they auto-lock after put in drive , but don't unlock when put in park? Or do the remote(s) for the keyless entry lock only but don't unlock? Are ALL locks and latches functional Including tailgate and hood?
Stuck switch? If it works on that model, try pulling the fuse for the door locks , leave it out for a minute and then re-install it. MAYBE that will 'reset' the system? Will they act up even if one of the doors is open?
i have the same problem with a 2005 Sorrento the doors will lock by themselves, was pumping gas with the car turned off keys in the ignition and all 4 doors locked not it is happening once a day randomly ????