Brainiac58 Posted June 22, 2007 Posted June 22, 2007 (edited) Hello all- I've created a staff scheduling database that calculates overtime worked by staff on a daialy and weekly basis. Supervisors enter in a start time and end time for each shift of the week and then total hours worked and overtime is calculated. I am trying to write a script or scripts that will do two things. 1. flash up a warning message when a staff member is scheduled for more than 12 hours of overtime on a shift; 2. Flash up a warning message when there is less than 8 hours between two shifts. I have a field for multiple staff members for each day of the week (for example staff member one's monday hours would be Staff1MonHrs). I think I know how to do the logic. For example, the first script would look like: If Staff1MonHrs > 12 Show Custom Dialog ["Warning! Staff member is working more than 12 hours!"] End if How do I get the script to run as supervisors are entering in hours in the schedule database? Any help will be greatly appreciated! Edited June 22, 2007 by Guest
GC GYM Posted June 22, 2007 Posted June 22, 2007 Hi You need a calc field not a script. IMHO you need a new field in your table (called hours warning or something like that) It should be a calculation field. Result is text. The calc should be like you have suggested for the script: If( Staff1MonHrs > 12; "Warning! Staff member is working more than 12 hours!"; "") End if Then in your layout you place the field (make it see through not opaque) When the condition is met i.e. staff hrs go over 12, the warning will appear on your layout. When the condition is not met, the calc returns "" i.e. nothing so you don't see anything. If you like, make the text big and red and loud and over the top of what they're looking at so it really hits them in the face! hth Phil
Recommended Posts
This topic is 6365 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