i get a messsage saying something about being unable to lock a field that has the focus.
well as per your statement that sometimes it gives you a message that a field cannot be locked when it has a focus. so allyou have to do is to have the focus on your command button before theevent works. if yiou are trying to lock a field when it has focus or lets say a subform when any of its fields had focus then it will not lock.