June 22, 200718 yr 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, 200718 yr by Guest
June 22, 200718 yr 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
Create an account or sign in to comment