>>>Does anyone have or know of a delete button class which will allow me to delete child records of the parent? I realized (rather late I'm afraid) that the delete button I'm using assumes I want to delete for the master alias, and pays no attention to the children.
>>>
>>>I made things complicated for myself in that I was trying to use the same set of buttons at the bottom of the form and have them apply to my master table when I was on Page 1 of a page frame, and the child table when I'm on Page 2. The other parts seem to be working, but the delete is really insufficient.
>>>
>>>On the other hand, who needs to delete anyway;)
>>>
>>>Thanks,
>>>
>>>Sylvia
>>Sylvia,
>>Using referential integrity for database I think a button with only a custom property cAlias2OperateOn would be sufficient.
>>Cetin
>
>Cetin -
>Can you be more explicit about what should that button contain)?
>Sylvia
>P.S. When do you sleep <g>?
define class DeleteButton as commandbutton
cAlias2OperateOn = ""
procedure init
if empty(this.cAlias2OperateOn)
cAlias2OperateOn = alias()
endif
endproc
procedure click
..
if lConfirmedDeletion
delete in (this.cAlias2OperateOn) next 1
tableupdate(0,.f.,cAlias2OperateOn)
...
endif
endproc
enddefine
I currently don't have a ready class for that so only the outline here.
P.S Would you believe if I say nights.
Cetin