Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deletinf child records of parent
Message
From
10/10/1999 21:31:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Deletinf child records of parent
Miscellaneous
Thread ID:
00274808
Message ID:
00274808
Views:
57
Hello:

I have a grid with a command button for deleting
a session(parent) and want to delete all of the
children for that session. The recordsource for this
grid is only the parent, it calls other forms that
have other grids that link master. etc.

I've done this in the past with similar screens and never had a problem child records don't seem to be deleting. I select the record
in the grid I wish to delete and hit my delete button.

Here's my code in my delete button:

Select myparent
csessionkey= myparent.sessionkey
delete
replace myparent.lc_action with "D"

Select Mychild
locate for mychild.sessionkey = csessionkey
do while found()
currec= recno()
go currec
delete all for mychild.sessionkey = csessionkey in mychild
replace all mychild.lc_action with "D" for mychild.sessionkey = ;csessionkey

Parent table deleting fine but not child.

Am I missing something?
Reply
Map
View

Click here to load this message in the networking platform