Solved

Table Structure in Access

Posted on 2012-03-30
4
318 Views
Last Modified: 2012-06-22
I am creating an access database to create weekly reports on the activities of employees in our company. I have most of my tables set, but have run into a complication with one and am hoping to get some advice.

My tables are as follows:
  tbl_Employees (fields are: empID, empFirst, empLast)
  tbl_TaskOrders (fields are: toID, toNo, toTitle)
  tbl_SubTaskOrders (fields are: stoID, stoNo, stoTitle, toID)

The way this works is that there are task orders (categories that activities and people fit into for purposes of invoicing), and within the task orders are subtask orders. For each subtask order there are either individuals or groups of people that work on it.

What I originally did was include a field in the Subtaskorder table called "stoMembers" and this was a multiple item, look up field that would contain the employee ID numbers of all those on the subtask orders. However, that is not working and I suspect it is poor design.

Does anyone have any advice for how this should be designed?

Thank you!
0
Comment
Question by:Megin
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
OCDan earned 100 total points
ID: 37789374
personally I would have another table STOGroups with the fields:
STGID, stoID, empID

So for one task you would end up with a list like this:

stgID      stoID      empID
1                  1                  253
2                  1                  276
3                  1              289
4                  1                   246

This links to your sto table via stoID and then you have 4 employees assigned to one sto.
0
 
LVL 5

Assisted Solution

by:hafeezmca
hafeezmca earned 100 total points
ID: 37789420
Hi,
You can acheive this by the following structure:

tbl_Employees ( empID -- Primarykey , empFirst, empLast)
  tbl_TaskOrders (toID -- Primarykey, toNo, toTitle)
  tbl_SubTaskOrders ( stoID -- Primarykey, stoNo, stoTitle, toID -- Foreign Key)

As you mentioned each subtask may have multiple employes you need to create one more table like below:

Create one more table say EmpSubTasks(empsubtaskId -- Primarykey, stoId -- Foreignkey, EmpId -- Foreignkey)

Note: empsubtaskId is not mandatory, you can even move ahead with stoId & Empid for the new table. But in case if you add two records with same value delete operation will be difficult.

Hope you will be able to achieve your task with the above mentioned solution.
0
 
LVL 9

Expert Comment

by:OCDan
ID: 37789432
I'm guessing you didn't mean to just post the exact same answer as me but changing  stgid > empsubtaskId?
0
 

Author Closing Comment

by:Megin
ID: 37789466
Thank you for the answers, both of you! I am trying it out now. It makes sense to me.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question