Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a checkbox to display deleted records
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01446020
Message ID:
01446219
Views:
130
>Make the corntolsource for the checkbox be the DELETED() function. In the click event add this code;

Thank you both Jim and Naomi. I am still not sure how to make the control source the deleted() function. Tried putting the word "deleted()" in the control source, but it does not accept it.

However I got it to work well with the following code:

First Jim's code in the Click event of the checkbox:
IF DELETED()
   RECALL
ELSE
   DELETE
ENDIF
this.refresh
But this on it's own leaves the checkbox ticked for all records, or unticked for all records.

Therefore added some similar code in the Refresh method of the checkbox as suggested by Naomi.
IF DELETED()
   this.Value = 1
ELSE
   this.Value = 0
ENDIF
This keeps the checkbox ticks in sync with the deleted records.

Thank you both for your help. This has been a great help. (Could not find anything on this subject when searching the UT.)

regards
David Wheeldon
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform