Hello,
Is is standard statecode field or custom?
If it is standard then changing of field to "Inactive" state will automatically lock fields on the form.
If it is custom then you will have to write a script that will do that for you.
Check this.
Dynamics CRM/Business Solutions MVP
Read My blog