Solved

Table Structure in Access

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now