Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete already!
Message
From
27/08/1998 09:28:01
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00130334
Message ID:
00130483
Views:
29
>Your code is in the right place. You need to have NoDefault at the end while deleting the child records AND the parent record in the grid. That is the only way I got this to work correctly for deleting records in a grid. Example:
>if MessgeBox("Really Delete This Record?") <> 6
>   NoDefault
>   Return 0
>endif
>lnSelect = Select()
>select ChildTable
>delete while ChildTable.KeyID = ParentTable.KeyID
>select (lnSelect)  && presumably the parent table
>delete next 1
>* Note: you may need to add code to move record pointer
>*       off deleted record to remove it from view.
>this.refresh() && refresh grid
>NoDefault
This is basically the same as one of the ways I tried, except I just did "delete", not "delete next 1". Does that make a difference?

Is there any difference between "delete while" and "delete all for"?

Thanks,

-Michelle
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform