PDA

View Full Version : Help with Delete Record


ABC123

Fred Daniel
03-12-2005, 12:58 PM
Has anybody developed a script or Xbasic code that can be used with a button on a form to delete a record without the Alpha Five standard box poping up?

forskare
03-12-2005, 02:13 PM
Hello Fred,

I found this in a search using "delete record"

Msg ID: 67713
Subject: RE: Delete record & x-dialogue
Author: William Hanigsberg
Date: 06-15-2004 9:43 PM
File:

Hi Ken,

Whether or not you get the confirmation dialog depends on whether you employ form or table methods to delete the records. As far as I know, if you use form methods you are stuck with the dialog.

formname.Delete_record()

However, if you use table methods you do not get the confirmation dialog. The following code runs from a button on a form. It deletes the currently viewed record and does not elicit a confirm dialog.

t=table.current()
t.change_begin()
t.delete()
t.change_end(.t.)
parentform.refresh_layout()

Note the last line; we need to refresh the form to match the table we just edited.

I am sure both methods can be achieved by action scripting but it is much easier to understand what is going on if you view the underlying code.

Bill

kenn

Tom Cone Jr
03-13-2005, 02:03 AM
Fred,

this is asked often.

A simple search on

delete record popup

turns up: http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=11&id=14976&thread=14976#MSG15003

-- t

Fred Daniel
03-13-2005, 03:22 AM
Thanks Tom, You were right on the mark as usual. Works Great!!!