To lock a field you woudl use the object name and then the add the property called access to lock/unlock the form. So if the field name is Object1 the command to lock the field woudl be Object1.access = "readOnly". To unlock the field you woudl use Object1.access = "". Note that the case of the objects and the commands is important.
You will need one command for each field you want to lock.
Paul