Results 1 to 9 of 9
  1. #1
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29

    Relation between tables

    Hi I'm making my first Time sheet layout in Access, everything is working out except the relations between my tables.
    I have made a simplified version of my database in a separate file which I've attached, I would appreciate if somebody could take a look and explain where to make the proper relations.
    Attached Files Attached Files

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It is often better for you as developer, and for us as readers, if you write a brief description of WHAT you are trying to accomplish in plain English.
    That helps us all to know What things are involved, what some of the attributes are and What business rules/facts exist. All of this helps with database and table structures.

    Eg We are a small company of 20 employees. We build, sell and maintain widgets. All employees are "hourly" in that they get paid based on hours worked. Our workday begins at 8:00 AM and ends at 4:00PM. Our normal workweek is Mon -thru Friday. Work outside of those hours is considered overtime. ...bla,...bla

  3. #3
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Of course .
    I work at a relative small company were I'm a project leader in The Netherland.
    The projects I do are done with +/-20 employees on-site and consist of maintenance work.
    The work is done at different hours and on multiple work orders per day.
    Because every project leader is responsible for there own paperwork, I started to make a database to make life easier.

    At this moment I'm working at a time-sheet application, eventually making it possible for everybody working on the project to fill in and print there own time-sheet.
    At this moment I have made three tables one with all the employees, one with the time-sheet data (start time, end time, project/work orders, and date) the last table contains all the work orders. My idea is to have a form were you first choose the employee and after that using a multi record sub-form to fill in the time-sheet data.
    My choice for the multi record sub-form is based on the fact that the employees are working on several work orders per day.
    After everything is filled in I want to save and print the time-sheet using a query which asks which employee and which date, and finally opens the report of the selected employee en date.

    The problem I encountered is how to make the form and relationships between the different tables.
    Especially between the form with employee data and the sub-form with the time-sheet data.
    The query and report is not the problem, thanks to this forum

    I hope this all makes sense..

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    At this moment I have made three tables one with all the employees, one with the time-sheet data (start time, end time, project/work orders, and date) the last table contains all the work orders. My idea is to have a form were you first choose the employee and after that using a multi record sub-form to fill in the time-sheet data.
    The database I looked at had only 2 tables - there was no workOrder table.

    Sounds like your basic table and relationships would be similar to the attached jpg

    Your forms etc are all based on your tables and relationships. Get those designed to support your needs, then move to queries, forms and reports.

    If employees can enter their time start and end, I think your data will be more accurate. If employees fill in their time sheets at the end of the day, you're dependent on their recollection for accuracy. The related interfaces to the system will depend on how your processes are set up/working.

    Good luck.
    Attached Thumbnails Attached Thumbnails EmployeeWorkOrder.jpg  

  5. #5
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Thanks for your reply.
    I choose for the option to let them fill in a complete time-sheet ones a day.
    Because most of our employees get there work orders in the morning and come back in the office at the end of the shift, by that time they already filled in all the work orders of that day by hand.

    I will start with you structure today and keep you posted!

  6. #6
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Just finished my new structure as shown in the image below.
    Now I'm trying to make a form as I described earlier, unfortunately without much luck..
    I have started with making a multi record form based on the TimeSheet table using the StartTime,EndTime, WorkCode, WorkOrder and remarks.
    This because these are the only fields that need changing.

    Now I'm stuck on how to create a form for the Employee data and timesheet date and incorporate my multi record form (as subform).
    The idea would be to only fill in the Employee and date ones and use the multi record form to fill in the times worked on each work order that day.

    Click image for larger version. 

Name:	AccesScreenShot.jpg 
Views:	14 
Size:	42.6 KB 
ID:	19565

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I responded to another poster yesterday re form/subform here.
    There is a demo database in post #8 .
    It is a different subject matter, but if you read the thread dialog and look at the demo, you may find it useful.
    Good luck.

  8. #8
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Thanks for the link and effort, works great now!!!

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Glad it was useful. Happy to help.

    I still recommend that you take your latest model, identify what you want out of your database (reports/forms)
    then build some representative test data and scenarios. Test your model with these test scenarios. If any issue arises, determine exactly what the issue/cause is and adjust your model, or your data accordiingly and test again until the model supports your data. Then proceed to build the database.
    Good luck.

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

Similar Threads

  1. how to make relation tables
    By Bala in forum Access
    Replies: 1
    Last Post: 11-07-2013, 06:35 AM
  2. relation ship
    By sarab565 in forum Access
    Replies: 4
    Last Post: 12-02-2011, 01:53 PM
  3. Joining 2 Tables based on a Common Relation to Another
    By StudentTeacher in forum Programming
    Replies: 5
    Last Post: 07-26-2011, 07:23 AM
  4. Relation in three different tables
    By kzdev in forum Access
    Replies: 1
    Last Post: 11-22-2010, 03:12 AM
  5. Replies: 1
    Last Post: 11-12-2010, 08:14 AM

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