Avatar

Level 10

Hi,

A couple of things:

If the function is expecting two parameters, then you will have to pass two parameters when calling the function. There are a couple of versions of this solution around, some with the "Lock" parameter. Just make sure you are using the correct one.

Instead of looping though the instances, just reference the parent of the button:

varLock.LockAllFields(this.parent, "Lock");

If the button is inside a subform, inside of the TRANSMITTAL subform, then it would become this.parent.parent.

Hope that helps,

Niall