StrataFrame Forum

Prevent user from editing certain records...

http://forum.strataframe.net/Topic3267.aspx

By StarkMike - 10/3/2006

Which event do I use to check a condition then cancel the editing of a record?



For example... I want to prevent the user from editing a record that has been closed. So I want to check the value of a field when they press the Edit button on the maintenance toolbar. If the value in that field matches closed then I want to cancel that edit and notify the user.
By StrataFrame Team - 10/4/2006

There is not an event hook to allow you to cancel an edit, but the Edit() on a form (the one that is called by the maintenance form toolstrip) is overridable, so you can override it, test your condition and then either bail or call the base Edit().
By StarkMike - 10/4/2006

Thanks Ben. I was not able to find the Edit called by the Toolstrip. Could you please tell me how to find it. Thanks
By Trent L. Taylor - 10/4/2006

It's on the form, not the toolstrip.  MyForm.Edit().