Solved

Table Structure in Access

Posted on 2012-03-30
4
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

752 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