From: ralph h. <1st...@1I...> - 2004-04-16 12:29:01
|
In my pythoncard app (memmaint.py), I have a dialog box displayed when they press the "delete" button. When I click the delete button the code works as desired. It displays the dialog with OK/CANCEL and then an alert to notify me that the record has been deleted. Apparently this changes the functionality of the form close event as well. After I press Delete and then press File->Exit or the Close form (X) button, the delete event is fired again. def on_DeleteButton_mouseDown(self, event): keyfld="["+self.components.SSN.text+"] "+self.components.LastName.text+","+self.components.FirstName.text result=dialog.messageDialog(self, 'Delete Member: '+keyfld,'Delete Member') if result['accepted']: whereclause="WHERE LNAME = '"+self.components.LastName.text+"' AND FNAME ='"+self.components.FirstName.text+"' AND MI = '"+self.components.MI.text+"' AND SSNUM ='"+self.components.SSN.text+"'" Memselect="SELECT * from member "+whereclause self.Memcursor.execute (Memselect) rows=int(self.Memcursor.rowcount) if rows == 1: #Insert into member_deleted Memselect="insert INTO members_deleted SELECT * from member "+whereclause self.Memcursor.execute (Memselect) #Delte from member Memselect="DELETE FROM member "+whereclause self.Memcursor.execute (Memselect) self.rowcount -= 1 self.showSelected() dialog.alertDialog(self, 'Member DELETED', 'Information') _____________________________________________________________ ======================================= www.StrictlyEmail.com ...our name says it all! |