Results 1 to 7 of 7
  1. #1
    rcrooks is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2015
    Posts
    2

    Database design for multiple employees on one job

    Hi there!

    I am designing a database that will essentially keep track of all of our companies jobs. Now, the way the old excel one works is you have for instance:

    Job Number
    Contract manager
    Engineer
    Senior Engineer

    Basically multiple employees working on a job. These are entered each time a new job is created. Massive potential for wrong data being input...

    The way I initially went about designing it was to create a table for all of the companies employees, another table for all the departments. You can create an employee and assign them to a department via a dropdown fed from the department table. When you create a job, you would fill in the contract manager, engineer and senior engineer form fields (via a drop down box feed from the employee table).

    Now, I believe I have hit a problem. Each employee has an email assigned to them in the employee table. Now, when search through the jobs in a form, I need to display the contract manager, engineer and senior engineer's name, and their email address. The forms data source is from the MASTER table (job detail). I have tried a query for this, using a relationship between MASTER and EMPLOYEE, but because their is multiple fields linking to multiple employees, it doesn't seem to work. Name is the easy one as this is a field in the job table. Email though is stored in the employee table.

    I cannot figure out how to pull through the employees email for the contract manager, engineer and senior engineer.

    Do I need to create another table here containing each employees job assignment and query the job number against this table, rather than storing them on the master job table?

    Current tables

    MASTER (job list)


    Job Number (primary key, unique number)
    Contract Manager (drop down referencing the EMPLOYEE name built from a query)
    Engineer (drop down referencing the EMPLOYEE name built from a query)
    Senior Engineer (drop down referencing the EMPLOYEE name built from a query)

    EMPLOYEE
    Name (Manually typed in via form)
    Department (drop down populated from query of DEPARTMENT table)
    Email (manually typed in via form)

    DEPARTMENT
    Name (Manually typed in via form)

    I hope i'm making sense here, and i've provided enough information...

    And thanks for any help you can provide!

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    hopefully you are not using name as your real field name - it is a reserved word and using it can cause problems - change to EmpName, DeptName or similar to avoid issues.

    You have a potential issue by linking on name - what happens if you have two employees with the same name? or one is female, gets married and changes their name?

    That said you need to link your master table to the employee table on name - three times, once for each role. then you can see the email address.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    The employees table would have to be included in the query 3 times, 1 of each linked to one of the 3 fields (manager, engineer, sr engineer). Do not use INNER JOIN, use RIGHT JOIN. Bind textboxes to the fields from Employees table but do not allow edits in those, set Locked property to Yes.

    Alternatively, the comboboxes can have additional columns with the employee info. Expressions in textboxes can reference columns of combobox by index. Index begins with 0, so like:

    =[cbxManager].[Column](2)


    EDIT: agree with Ajax - should be saving and linking on EmployeeID, not names.
    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.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    And should not have given name and surname in the same field. Should be 2 fields. (Ex. FName, LName or FirstName, Surname)

  5. #5
    rcrooks is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2015
    Posts
    2
    Thanks for all your replies. I was a little short in giving information about my main table as there is roughly 30 fields. I appreciate your help and it has made me think differently about the problem.

    I have create an "employeejob" table now. This links to the master table containing information about the job, and links to the employee containing information about the employee:

    Master: SiteID, Site Name... etc
    EmployeeJob: SiteID, EmployeeID, JobTitleID, JobID
    Employee: EmployeeID, EmployeeName, EmployeeEmail, Department
    JobTitles: JobTitleID,JobTitleName

    This way I can assign an employee to a job on a site, and have many employees working on a site, and one employee working on many sites.

    My relationships work spot on now, and it future proofs things if you need more people on site. I'm using a split form to pull up all the employees on a currents site (the master table is the record source on the main form), and grab their emails too.

    Does this sound OK to proceed, or can you spot any potential pitfalls?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    What do you mean by 'split' form and 'main' form? Did you mean form/subform arrangement? A split form is a special type of form object.
    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.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Getting your tables designed to support your business involves several things. It's easier if you have a good description of your business --no jargon --just plain English. You might want to "bounce your completed description off colleagues to ensure it is complete and understandable.

    There are some tutorials at RogersAccessLibrary that lead you through a process from your business description through the identification of entities/tables,fields. keys and relationships. I recommend you work through 1 or 2 of these before jumping further into Access.
    This one or one under the examples will help you with structure.

    Good luck.

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

Similar Threads

  1. Help to design a small database for 30 Employees
    By awan-trainings in forum Access
    Replies: 2
    Last Post: 05-19-2013, 11:13 AM
  2. Replies: 2
    Last Post: 08-15-2012, 11:42 AM
  3. Employees Database Management System
    By salsai in forum Database Design
    Replies: 3
    Last Post: 01-22-2012, 12:45 AM
  4. Search employees backup database
    By mademen in forum Access
    Replies: 4
    Last Post: 12-19-2011, 03:30 PM
  5. Add Multiple Employees to a Training
    By Voltzwagon in forum Forms
    Replies: 1
    Last Post: 01-29-2010, 10:53 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