alloyd Posted February 13, 2003 Posted February 13, 2003 I have a script that does the following:- Set error Capture [On] Open [Open Hidden, "Colleger Register"] if [status(currentError)=0] SetField[Register Online Status", "Online"] Else SetField[Register Online Status", "Offline"] End if The script works fine most of the time, but occasionally sets the field to "online" even when the "college register" file has not been found. In other words Status(CurrentError) is returning 0 after an error on open. Anyone any ideas?
andygaunt Posted February 13, 2003 Posted February 13, 2003 Hi, Rather than looking for the positive, have you tried looking for the negative. By looking for the actual error may help you out. Error code 100 is File missing. Set error Capture [On] Open [Open Hidden, "Colleger Register"] if [status(currentError)=100] SetField[Register Online Status", "Offline"] Else SetField[Register Online Status", "Online"] End if HTH
BobWeaver Posted February 13, 2003 Posted February 13, 2003 You could also use the design function DatabaseNames to check for which files are open Set Field [Register Online Status, Case(PatternCount(DatabaseNames,"Colleger Register"),"Online","Offline")]
Recommended Posts
This topic is 7958 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