There's no reason to use code for this. You'll need to create a separate (non-displayed) field to hold the value for whether the control is enabled or not. You can call it [ControlFieldsName]Enabled. Add an action rule to the button to set that field to false, and then add conditional formatting to the control to disable it when that field has the value false.
Jimmy Rishe / Software Developer / Microsoft MVP
Qdabra Software