Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete class for parent/child
Message
From
08/05/1998 13:18:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/05/1998 13:16:22
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00098115
Message ID:
00098136
Views:
28
>>>>>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
>>* Check editmode and Messagebox here for confirmation
>>..
>> if lConfirmedDeletion
>>  delete in (this.cAlias2OperateOn) next 1
>>  tableupdate(0,.f.,cAlias2OperateOn)
>>* Or SQL delete
>>* Move rec pointer to a nondeleted if set del on
>>...
>> 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
>Cetin -
>Thanks, I'll try working on this.
>P.S. Er, you must have some short nights in Turkey;) Seriously, what is the time difference? It's 1:15 p.m. here.
Here 20:20 now.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform