3 Replies Latest reply on Sep 30, 2010 12:35 AM by AndrewClarkson

    Help with creating a sign-in database

    AndrewClarkson

      Title

      Help with creating a sign-in database

      Post

      Hi,

      I'm fairly new to Filemaker Pro, and just wanted to check with some experienced people about how to create a sign-in database for a local volunteer rescue organisation.

      To explain more clearly, once volunteers arrive at the office - they will need to sign in using an ID number. Once they leave, they need to sign out and enter the activities they completed.

      So I have set up the following system:

      - For sign in, I have a page with a "Sign in" button. Once clicked, this creates a new record, and requests the users ID number. The "time in" field is automatically filled with the current time. The user receives a confirmation and then the database returns to the main menu layout.

      - For sign out (this is where I am having problems) - I have the user enter their ID number and then Filemaker searches for their record and enters the sign out time and activities completed. The problem is, I don't know how to get Filemaker to select the most recent record. If the user comes in everyday for two weeks - Filemaker seems to always choose the oldest record. Does anyone know how to solve this?

      Also, I'd really appreciate any tips on the structure of what I have set up, and if I have done it completely wrong?!

      Thanks very much!

        • 1. Re: Help with creating a sign-in database
          sunmoonstar.13

          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.

           

          Nick

          • 2. Re: Help with creating a sign-in database
            philmodjunk

            Sounds like you need three or four tables: Personnel, Log, ActivityLog, Activities (May not need this last table).

            Personnel----<Log---<ActivityLog>---Activities

            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]
            Perform Find[]
            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
            End IF
            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.

            • 3. Re: Help with creating a sign-in database
              AndrewClarkson

              Wow thanks very much - I'll give it a try!!