Results 1 to 5 of 5
  1. #1
    jairgarza is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    18

    Question Students Sign-In Sheet with Time in / Time out

    Hi there,

    I am definitively not an advanced Access user, but I always find my way around it, VBA, creating tables, queries, etc.

    That being said, I am trying to build a "sign-in Form" for a School Office. They receive students on a daily basis for several reasons (reasons we do not need in the DB). What I would like to do is to build a form that allows a dedicated user to scan ID's, then what happens next is the trick:

    * Get student name from Students DB (Table) and show it on screen
    - St_ID (PK)
    - St_Name
    * Add a new record to Daily_Signin (Table)
    - St_ID
    - St_Name
    - Date_in (MM/DD/YY)
    - Time_in (HH:mm:ss)
    - Period_in (based on the time, i.e. 7:20 - 10:44 = 1st period)
    here is where it gets trickier for me, on same table (or maybe a new one?)
    - Time_out (HH:mm:ss) no need for date as it should always be the same day


    this Time_out should be recorded when the student leaves the office, now how to achieve this? well the first thought is of course to scan the ID again, hopefully on the same form and using VBA compare if the student has ONLY 1 Time_in with no Time_out and then add the time_out, yet a student can be in the office several times a day (not often, but possible), which in case I need for the code to be able to check for if student has a pair (or more) of time_in & time_out already, then to mark a new time_in

    I would then need to run Reports by period_in for today (not a big deal once I have the data )

    Any ideas how/where to tackling this mess?

    Thank you very much for all/any of your help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you dont need a Date field AND a time field. 1 date field hold both and you want them togther....

    DateIn (as date and time) general date
    DateOut (as date and time)

    this lets you do the elapsed time.
    as to the design, you must decide on a design:

    userID, datein,dateout
    on the same record, then you must find it again
    or
    userID, TimeStamp ,
    but this doesnt determine in or out, and you must sort the records in order to determine in/out.
    or
    userID, TimeStamp , IO
    where you can click IN or OUT on the form then scan, but that needs user interface AND they may choose the wrong IO.

    which do you want to use?

  3. #3
    jairgarza is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    18
    Hi ranman256,

    Thanks for the prompt reply.. I would definitively like to use the first option you mentioned:

    userID, datein,dateout
    on the same record, then you must find it again


    Where to start?

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    theres no good solution.
    a person may fail to login / or out and that disrupts the entire setup.
    but to get started:

    Code:
    sub txtBadge_afterupdate()
    dim vRet, vBadg
    
    docmd.Setwarnings false
    
    '[scan badge]
    vBadg = txtBadge
    vRet = Dlookup("[LogID]","tTable","[BadgeID]='" & vBadg & "' and [dateOut] is null")     'see if they already have an open record
    
    
    if IsNull(vRet) then  'not clocked in
         sSql = "Insert into tTable (BadgeID,[DateIn]) values ('" & vBadg & ",#" & now() & "#)
         docmd.runSql sSql
    else
       'we got the record , so close it:
    
    
         sSql = "Update tTable Set [DateOut]=#" & now() & "# where [LogID]='" & vRet & "'"
         docmd.runSql sSql
    endif
    
    
    docmd.Setwarnings true
    end sub

  5. #5
    jairgarza is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    18
    wow! that is quite a nice code... I am sorry for the delay, been addressing technology issues in the building... I will definitively try it and let you know... many thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Displaying Time sheet data in Horizontally
    By bronson_mech in forum Reports
    Replies: 36
    Last Post: 02-21-2017, 12:14 AM
  2. Replies: 1
    Last Post: 05-21-2016, 08:51 AM
  3. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  4. Time sheet setup help
    By xAkademiks in forum Access
    Replies: 1
    Last Post: 10-13-2010, 10:44 PM
  5. Suggestions for Time Sheet Layout?
    By eww in forum Access
    Replies: 1
    Last Post: 08-12-2010, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums