Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record in cursor created with CA
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01477582
Message ID:
01477605
Views:
31
>>First the explanation of why. I have a column REC_ID with the value of '0' for "non-deleted" records. When user deletes a record, I don't want to delete it but change the value of REC_ID to "D". So, on command to delete a record (user thinks he/she actually deletes), the program changes the value of REC_ID to "D", sends TABLEUPDATE(). This updates the base table and therefore on the next reload of the CA the record will not be shows to the user. But immediately upon setting the value of base record column REC_ID to 'D' I want to remove this record from the cursor. I suppose the above code you suggested should work. Thank you.
>
>
>Then you you should use and easier way :-)))))))))))))))
>Every CA have a DeleteCmd property.
>You should made it something like that:
>
>this.DeleteCmd = "UPDATE YourTable SET Rec_Id = 'D' WHERE PK_Field = ?"+this.Alias+".PK_Field" 
>*** Just change PK_Field to the real name of that field
>
>
>Then delete your records in CA and use TableUdpdate as you wish.
>(this is NOT tested)

You initial suggestion of setting property SendUpdates to .F. and then to .T. works. So the approach to delete (or set REC_ID to 'D' ) can be done either way. Again, my question was how to remove a record from the cursor without affecting the base table. Which you answered.

But getting back to the code in this message you are suggesting. I have not used the .DeleteCmd property of CA yet so I will have to see how it works.

Thank you for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform