November 25, 200421 yr I am working on a timeclock module that has a simple START & STOP button. Each button activates a script that inserts the current time into a Start and Stop Field. I track the elapsed time with a simple calculation. Is there a way to insert these values with a button script and prohibit modification after the button has been pushed? Thanks for any help here. Jarvis
November 25, 200421 yr Since START and STOP are filled via script; and since you have vs. 7, use Field Behavior and disallow entry in Browse and Find. Your script buttons can still fill the fields but Users can't enter them. If, for some other reason, you need Users to have access to this field, it can be controlled via extended privileges but what you've described wouldn't require that kind of lockdown. If they need the ability to clear the fields, provide a CLEAR (or RESTART) button also. In your Start and Stop scripts, you may want to check 'Run Script with Full Access Privileges.' If you don't want the buttons to change the start and stop times after they have been entered, just change your script. Personally, I would use Set Field [ ] instead of Insert Current Time something like: Set Field [ If(IsEmpty(Start; Get(CurrentTime); Start) ] ... which would insert the current time if empty but wouldn't change if a time already exists in the field.
November 25, 200421 yr Author Thanks alot Moon Shadow! You gave me more information than I was hoping for. Jarvis
November 25, 200421 yr "You gave me more information than I was hoping for." As Queue would say ... My bad? I HAVE been getting a bit long-winded lately.
November 25, 200421 yr Author MoonShadow, More help please. I like the SET FIELD approach but I can't figure out how to use Field Behavior & disallow entry in Browse and Find. Thanks, Jarvis
November 25, 200421 yr Select your START time field. Right-Click and select Field Behavior. Unclick Browse and Find.
Create an account or sign in to comment