Update db table B from table A with button press

The top table is table A and the bottom is table B.
On table B I have polling turned off.
On table A I am coping table B and have editable rows
I edit table A the press the button and it moves the data into table B where I have an update on cell edit
Code as follows

database = event.source.parent.parent.DatabaseConnection
sequencetable = event.source.parent.parent.SequenceTable
connection = "["+database+"].[dbo].["+sequencetable+"]"
table = event.source.parent.getComponent('Table')
if table.selectedRow != -1:
	ndx = event.source.parent.Key_Ndx
	columnname = table.data.getColumnName(table.selectedColumn)
	value = table.data.getValueAt(table.selectedRow, table.selectedColumn)
	print connection
	query = "UPDATE "+connection+" SET "+columnname+" = ? WHERE Key_Ndx = ?"
	system.db.runPrepUpdate(query,[value, ndx])

But it won’t update.

The reason I want to do it this way is to force notes to be taken and be able to edit an entire table at once.