Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Deletinf child records of parent
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?
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement