Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1865
Reset cell value to original
posted

I want to prevent the user from editing a cell/field value if another boolean field is set to true.

 

In CellUpdating event, I save the value of the cell to a variable named originalValue. In CellUpdated event, I validate this value vs the other boolean field and set it back to originalValue if that is TRUE and show a messagebox. However, this is not working as it keep refiring the event. I tried a couple of other options using the same to CellUpdating and CellUpdated events, but they didn't work.

 

What is the best way to accomplish this?

 

 

  • 138253
    Verified Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I handled both the CellUpadating and CellUpdated events like you, but I used two variables (originalValue and newValue) in order to determine if the value was reverted once. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    CancelUpdateBasedOnOtherCellValue.zip