Solved

Table Structure in Access

Posted on 2012-03-30
4
320 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

679 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