Results 1 to 8 of 8
  1. #1
    chriswrcg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2018
    Location
    Philippines
    Posts
    142

    how to keep my old data

    I have touched on this topic before but I still do not fully understand how this all works. If I go in to my database today and enter in the information from a particular associate and hit save, all the data is saved in it's particular field. But if I go in and enter the data from yesterday the data I put in for today is lost.

    example:


    associateiD 1 (auto number)
    AssociateName McGhee, Dean
    Date: 10/3/2018
    ClockIn: 2:00 pm
    ClockOut: 10:00 PM

    Now it is tomorrow and I want to add today's numbers so i change the date to 10/4/2018 and the clock in and clock out times. the associate ID number and name stay the same.
    I want to build a daily record so that I can print daily, weekly, and monthly reports but by changing the three fields and saving I have lost the first days data.

    How can I go in and change it every day but keep what I entered yesterday. How can Access archive each days data so I can go back and get it at any time? Will I just keep saving a new database each day? I am really confused.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    sounds like you are missing a table. You need 2

    tblAssociates
    associateiD (auto number)
    AssociateName

    tblClocking

    ClockingID (autonumber)
    AssociateID long
    ClockDate date
    ClockIn date
    ClockOut date

    The associateID in tblClocking links back to associateID in tblAssociates to pick up the name

    Note that Date is a reserved word and should not be used for a field name

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    It sounds like you are overwriting yesterday's record with today's data instead of creating a new record for today and leaving yesterday untouched.

  4. #4
    chriswrcg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2018
    Location
    Philippines
    Posts
    142
    I know that this is going to be an eye rolling noob question but how do I create a new record for today without messing with yesterdays data?

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    go to a new record.

    at the bottom of table/query/form you will see this

    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	11.3 KB 
ID:	35756

    click on the icon circle in red

    if this does not answer your question, provide a screenshot of what you are seeing

  6. #6
    chriswrcg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2018
    Location
    Philippines
    Posts
    142
    Right now I have my Primary key set for auto number. This gives each of the people an individual associate number. If I click on new record, a new associate number will be generated for each day so that McGhee, Dean will have an associate number of 1 and then later 101 if I have 100 employees entered for the first day. Wont that mess everything up if all the relationships of all the tables is based on the auto number?

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Wont that mess everything up if all the relationships of all the tables is based on the auto number?
    see post #2. You need to read up on normalisation and database design

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Here's a quick example of Ajax's suggestion.
    The associate occurs once in the associate table.
    The clockins occur as many times as necessary for each associate in the clockin table. That's a One-to-Many arrangement.
    The main form record source is tblAssociates, while the subform source is tblClocking.
    Last edited by davegri; 10-08-2018 at 09:33 AM. Reason: sp

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

Similar Threads

  1. Replies: 8
    Last Post: 03-15-2018, 12:23 PM
  2. Replies: 7
    Last Post: 07-24-2017, 11:47 PM
  3. Replies: 9
    Last Post: 03-01-2017, 10:00 AM
  4. Replies: 1
    Last Post: 12-21-2011, 02:11 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