INSERT INTO table Error


I´m having some problems with my script , i am using system.db.runPrepUpdate in order to insert new information into my table but every time that the script is been executing my table is updated with the same information 4 times
My script looks like this:

`Preformatted text`Producidas =event.source.value
Cantidad = event.source.parent.getComponent('Numeric Label').value
DateDN=event.source.parent.getComponent('Popup Calendar').date
PartNum =event.source.parent.getComponent('Label 6').text
Sec = event.source.parent.getComponent('Label 7').text
Machine = event.source.parent.Maquina

if Producidas == Cantidad :
	system.db.runPrepUpdate("INSERT INTO ProductionComplete (PartNum,Sec,Cantidad, Estacion, Producidas, Fecha_produccion)VALUES(?,?,?,?,?,?)",[PartNum,Sec,Cantidad,Maquina,Producidas,DateDN])
	event.source.parent.getComponent('Button').visible = 1

Nothing obvious. This is on the actionPerformed of the button? You do a SELECT COUNT(*) FROM ProductionComplete, write down that number, push the button, run it again, and its 4 more records? Nothing I am seeing would suggest it should be running multiple times if this is on the actionPerformed extension function.

Only other thing I think you might want to inspect
event.source.parent.getComponent('Button').visible = 1 - does this component maybe have a property change on it relating to it's visiblity that's also running a query? Would be odd, but anything is possible.

If you make a brand new button, paste this script in, and press it, does it also insert 4 times?