tallboy755 Posted March 25, 2003 Posted March 25, 2003 I need a exit script that will clear the the checkboxes in a field for all records .... any ideas
Ugo DI LUCA Posted March 25, 2003 Posted March 25, 2003 I know it's dangerous, but Replace script function will do it for you : Got o Layout (where the field is) Goto field (select your field) Replace (your field, ""). If your need is for an exit script, there are some examples here on the forum.
Fitch Posted March 25, 2003 Posted March 25, 2003 Replace is slightly easier to implement, but you do have to be careful to be on a certain layout, and that the field you're changing is on that layout. The alternative method, that can be used whether or not you or the field are on a layout, is with a loop: Show all records Go to record [first] Loop ..Set Field [yourField, ""] ..go to record [next, exit after last] End Loop Note that both replace and looping can be problematic in a multi-user system: if someone else is using the record, that record will be locked and the script will fail. The usual workaround is to turn on error trapping and create a log file, then go back and deal with the errors later. If your system is single-user, you don't have to worry about it.
danjacoby Posted March 25, 2003 Posted March 25, 2003 One minor caveat: If the field is a Number Date or Time field, you need to SetField[yourField, TextToNum("")] -- or TextToDate or TextToTime, as the case may be.
nikarc Posted October 21, 2003 Posted October 21, 2003 Another caveat. If you have field validation turned on for any fields in the db and some records fail it, it will cause the loop to hang when it tries to go to the next record...
-Queue- Posted October 21, 2003 Posted October 21, 2003 This is why I prefer to validate by script whenever possible. Field validation can be a royal pain in the ass and screw a script up when you least expect it. If there is no choice, then I test for failed validation when Go(ing) to Field[ ] with: Loop Go to Field [ ] Exit Loop If [not Status(CurrentError)] Show Message ["Your data is jacked! Please fix it, then press Enter."] Pause/Resume Script [ ] End Loop
Recommended Posts
This topic is 7707 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now