Presumably when the user signs in, the current date is entered into a field somewhere, so when they sign out, the Find needs to be refined to search for the current date as well as the ID.
> Also, I'd really appreciate any tips on the structure of what I have set up, and if I have done it completely wrong?!
Hard to say without knowing what tables you have and how they're related.
Sounds like you need three or four tables: Personnel, Log, ActivityLog, Activities (May not need this last table).
One record in Personnel for each firefighter. One record in Log for each time a Fire fighter logs in and out. ActivityLog allows you to log multiple activities performed for a given Log record and you can use a 4th table to list and document activities if you need to record more info about your activiteis than just a simple list of their names.
To log firefighters out, I'd define a global field, gPersonnelID, where the firefighter enters their ID number (You can even set up a barcode reader or mag stripe reader so that they can swipe an ID card instead of typing in a number.)
Your script might look like this:
Enter Find Mod
Set Field [Log::PersonnelID ; Log::gPersonnelID ]
Set Field [Log::Out ; "="] //finds only Log records where Out is empty
Set Error Capture [on]
Sort [no dialog ; Restore] //sort records by In field in descending order
Go To Record [First]
If [ Get ( FoundCount ) = 0 /* no log records were found--firefighter didn't sign in. */ ]
//put code here to handle this situtation
Else If [ Get ( FoundCount ) > 1 /* Fire Fighter has failed to Sign out each time */ ]
//Do anything you might need to in order to deal with this situation
Set Field [Log::Out ; Get ( CurrentTimeStamp ) ]
Log::In and Log::Out fields should be defined as TimeStamp fields as these will then record both date and time for easier searches, sorts and elapsed time calculations.
Once the correct Log record has been pulled up, the Firefighter can use a portal to ActivitiesLog to record each activity they've performed.
Wow thanks very much - I'll give it a try!!