Results 1 to 4 of 4
  1. #1
    jabourgeois1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    17

    Two database combined, Table design, and code

    Here are some of my problems:


    1. When I log in as Student(ID 111222333 or 444555666) Tempvars is pulling that info over to the Clock in/clock out record (studentID textbox). Great! but it does not filter per the the student id. currently there is only 1 record for StID444555666.

    2.The Time in & out are reporting back to the table but not the workout time?

    3. How can I get the time in the Time in & out to round or round up to the nearest Minute. Not sure which would be better.

    4. I have the workout time rounded but Is there a way to show (timeID #9-ie 25 min/ #8-1 hr 45 min (:25 min/1:45). I figure the time needs to be rounded before the calculation for the workout time be correct. As it is if you clock in at 2:35:00 PM & Out at 2:5900 to30) PM it shows 24 min from 2:59:31-3:00:30 PM it shows 25 min.

    5. Just like the Total Workouts I am trying to have 2 more ( 1 for workouts over 25 min and 1 for under 25 min.).

    6. On the clock in / clock out instead of you have successfully clocked in/out at (time). Your clock in / clock out Time will be (time) with 2 buttons Clock In: Start Workout & Exit button. Clock Out: Stop Workout & Continue Workout.

    Attached is the database I have been working on.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    use date math functions:
    n=minutes

    DateDiff("n",[starttime], [endtime])

  3. #3
    jabourgeois1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    17
    #3 from above solved!!! I was needing the time rounded before the calculation. I was already using the round function in the workout time field on the clockin_sub form, using the Datediff function made no difference, but I did add the round function to each of the timein and the timeout fields on the default value properties line. =Round([TimeIN],0) / =Round([Timeout],0). This seem to have solved that problem, The time is now set to that minute for each field and then the datediff function takes care of the rest. In other words 9:20:59 = 9:20 and 9:21:00 = 9:21 = 1 (min)

    The next part of I am trying to figure out how to get "min." to show after the calculated time?
    Still need Help with #1,2,4,5,6!!!

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You can have "min." in a label. Or concatenate the string.

    Why does expanding address Subdatasheet provoke an input popup? I've never seen this at table level.

    Each student can have multiple addresses?

    Having an unbound textbox display the TempVars value when the form opens is meaningless. Textbox should be bound to field. Can set it Locked Yes and TabStop No. Not seeing any need for the TempVars.

    If you want form to open filtered to specific studentID then apply criteria to the OpenForm WHERE CONDITION argument. Concatenate reference to the textbox. Consider:

    Code:
    Private Sub btnstudentlogin_Click()
    Me.lblvalidID.Visible = False
    If Not IsNull(DLookup("[studentid]", "[tblStudentsBio]", "studentid = '" & Me.txtstudentloginid & "'")) Then
        DoCmd.Minimize
        DoCmd.OpenForm "frmClockIn", , , "studentid='" & Me.txtstudentloginid & "'"
        DoCmd.Close acForm, "frmStudentLogin"
    Else
       Me.lblvalidID.Visible = True
       Me.txtstudentloginid.SetFocus
    End If
    End Sub
    Saving calculated data requires code in some event. The real trick is figuring out what event. Otherwise, just run the calc when the data is needed.

    Is 4. resolved?

    Don't really understand what you want for 5.

    Write code as appropriate for the buttons in 6.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 10
    Last Post: 01-22-2016, 01:12 PM
  2. Replies: 6
    Last Post: 01-26-2015, 02:11 PM
  3. Replies: 3
    Last Post: 04-27-2014, 08:08 PM
  4. Table/Database Design Help
    By noaccessguru in forum Database Design
    Replies: 5
    Last Post: 08-27-2013, 11:31 AM
  5. Combined Table Repeating values
    By RedWolf3x in forum Queries
    Replies: 1
    Last Post: 11-02-2011, 04:39 PM

Tags for this Thread

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