Cell Edit Retained after Query Change

I am using a tab strip to filter ingredients in my process by using the tab strip name in the SQL query for a power table.

I have a cell edit script which updates the database with the amounts they consumed.

If the user clicks in the cell to update the amount, but neglects to hit enter or click outside of the cell and then clicks on the tab strip to go to another area, the table retains the cell being edited with whatever value is in it’s place. Once the screen is clicked on anywhere else that value gets applied in the database to whatever ingredient is represented on that row.

Do I need to write some sort of script when the tab strip name property changes so that it loses focus on the power table?