Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Access as TimeCard (2000)

    I want to use Access as a time card to record how many hours an individual worked on a particular machine on a given day. I am having a brain lock as to how to get Access to create a Date table that keeps giving me a field with the current day and keeps adding the days in as we add more records. Meaning I don't want to go into the table and type in 365 days for this year and then do this again next year.

    Each individual may have 2 or 3 entries per day because they may work on more than one machine per day. I only need to track hours. Any thoughts?
    Deb

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Using Access as TimeCard (2000)

    If you include a date field in the table with a default value =Date() then it will be automatically date stamped each time you create a new record. So if you create a data entry form that takes you to a new record, the date will be put in automatically.

    Presumable you only need a record when they do work on a machine.
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Access as TimeCard (2000)

    I need the date no matter what. Meaning if no one worked on Monday I need to list it, so when I run the report I can so every day, every machine and then the hours. Any thoughts?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Using Access as TimeCard (2000)

    If no one worked, who would be running the Access application to generate that "nobody worked" record?
    Charlotte

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Using Access as TimeCard (2000)

    I think you could have a "work records" table with a collection of date stamped records, and another table that just holds dates. when you run reports join the two tables using the date field. double click the join line in the query grid, and choose to select all records from the dates table.

    To avoid writing in all the dates you could write a function that adds any number of dates you like, after you put in at least one starting date.
    <pre>Function fnadddates()
    Dim db As Database
    Dim rs As Recordset
    Dim sql As String
    Dim lastdate As Date
    Dim counter As Integer
    Set db = CurrentDb
    sql = "Select * from tbldates"
    Set rs = db.OpenRecordset(sql, dbOpenDynaset)
    rs.MoveLast
    lastdate = rs!Date

    For counter = 1 To 5000
    lastdate = lastdate + 1
    rs.AddNew
    rs!Date = lastdate
    rs.Update
    Next counter
    rs.Close
    End Function
    </pre>

    Regards
    John



  6. #6
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Access as TimeCard (2000)

    It would be run by the manager and on that day. It's the worker bees that may not work. Is that a question like "if a tree falls in the forest....does it make a sound"?

    Thanks,
    Deb

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Using Access as TimeCard (2000)

    No, it wasn't a rhetorical question. I didn't know if you were intending to keep the application running continuously or you were trying to use a scheduled event to run it or what. Since a manager is going to run it, the question is answered.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •