473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Table and form design

I'm having trouble figuring out how to design my tables and forms to
suite my purpose. I'm creating a crewing database to assign and track
employees and jobs over multiple shifts. I would like each shift to
be able to fill out a simple form assigning each job to an employee
and then be able to keep a history of what job each employee did on a
given date.

So far, I have four tables:

Employees:
EmplyeeID (PK)
LastName
FirstName
ShiftID (FK)
Jobs:
JobID (PK)
JobName
JobDescription
Shifts:
ShiftID (PK)
ShiftName
Crew:
Date
ShiftID (FK)
JobsID (FK)
EmployeeID (FK)

Employees.EmployeeID relates to Crew.EmployeeID
Jobs.JobID relates to Crew.JobID
Shifts.ShiftID relates to Crew.ShiftID
Shifts.ShiftID also relates to Employees.ShiftID

Employees are assigned to a shift but have the ability to work other
shifts.

I'm thinking this must not be right because I can't figure out how to
create a form listing each position that will fill the crew table.
Also, this would mean that each shift would generate 30 records in the
crew table each day (one for each job), meaning that after a few
months this table will be HUGE.

What am I missing here? What would be a better way to do this? How
would I setup the recordsource of the elements in the crewing form to
properly fill the table?

Any help would be really appreciated! Thanks!

Feb 6 '07 #1
3 1618
>
What am I missing here? What would be a better way to do this? How
would I setup the recordsource of the elements in the crewing form to
properly fill the table?

Any help would be really appreciated! Thanks!
If I understand you correctly, I think you probably have it about
right. Unless you intend to assing a job to a crew and not a single
person.
As for the form, it could be as easy as a datasheet, or continuous
form where each field is a combobox gettin it's values from the
Employees,Jobs and Shifts tables - all these values being appended to
the Crew table. The ShiftID could default to the employees assigned
shift but be changeable.

An alternative would be to track jobs by date, and have another table
to assign employees to a job.

DailyJobTable:
JobInstance (PK) (Could instead use a composite key of JobId and
Date, but I prefer single field primaries)
Date
JobID (FK)
ShiftID (FK)

CrewTable:
JobInstance (FK)
EmployeeID (FK)

Feb 6 '07 #2
Thanks, it's nice to know I'm at least on the right track, and I like
your idea of having the DailyJob table.
I'm still unsure about how to implement the form. If I understand
correctly, I want one page of the form to be one day and one shift,
and I want that page to include a textbox where I can enter the
employeeID and then link that ID to the job and store it all in a
table. So each page on the form creates 30 records in the
DailyJobTable and in the CrewTable? How do I do this? I'm just
having a hard time visualizing how to make it work.

Feb 6 '07 #3
Prochot wrote:
I'm having trouble figuring out how to design my tables and forms to
suite my purpose. I'm creating a crewing database to assign and track
employees and jobs over multiple shifts. I would like each shift to
be able to fill out a simple form assigning each job to an employee
and then be able to keep a history of what job each employee did on a
given date.

So far, I have four tables:

Employees:
EmplyeeID (PK)
LastName
FirstName
ShiftID (FK)
Jobs:
JobID (PK)
JobName
JobDescription
Shifts:
ShiftID (PK)
ShiftName
Crew:
Date
ShiftID (FK)
JobsID (FK)
EmployeeID (FK)
This looks similar to work management (work order) type systems. Your
set up is awkward.

Presumeably a job is a task that occurs during a shift - an incident to
be addressed, a standard task that must be performed. If you are going
to do what you indicate in the second paragraph, above, ie, assign a job
to an employee, your set up is badly flawed.

What is the base unit of measurement of work? It is a labour line, so
you have a table missing. You need to assign the job to individual
employees.

Shift, crew and employee are all separate entities. If these are
important to the job, then they should be tracked separately.

---------------------------------------------------
Table Employees
Emp_PK (PK)
Emp_Last_Name
Emp_First_Name
Emp_Shift_FK (FK to Shift_PK) - see notes - not required

Notes - in my experience, employees can sometimes be transferred from
one crew to another and definitely from one shift to another. In my
opinion, the shift FK could either be left out entirely in the emplyees
table or you could have another table to track scheduling of employees
and shifts. Shift is important in the job tracking, but not necessarily
here. The shift seems to be covered by the crew.
---------------------------------------------------
Table Jobs
Job_PK (PK)
Job_Name
Job_Description

This table describes indiviudal incidents and scheduled work. In
actuality, for purposes of analysis of work, you will probably want a
"Job Type" table that describes standard job types or task codes with
possibly one or more further levels of hierarchy later on.
---------------------------------------------------
Table Labour_Lines
Lab_PK (PK)
Lab_Job_FK (FK to jobs)
Lab_Hours
Lab_Emp_FK (FK to employees)
Lab_Shift_FK (FK to shift)

Here is where the shift is tracked. I have included it at the labout
line level because if a job can be performed ver several shifts than
this will take care of that.
---------------------------------------------------
Table Shifts
Shift_PK (PK)
Shift_Name
---------------------------------------------------
Table Crew
? ? ?

I'm not 100% what this represents. This is could be a collector of
employees, ie, how they are organized. If so, then it is a hierarchy
under which employees are organized.

If it is something dynamic, then you need a look up table for employees.

Given you specified a date, I'm guessing the function of this table as
you might be envisioning it is actually performed by the jobs and
labour_lines tables. IOW, here are some jobs, here are the dates they
were done and by whom and on what shift.
---------------------------------------------------

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Feb 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Corinne | last post by:
I have a database that contains the details of pupils in a school. What I would like to do may not be possible but I thought I would ask anyway. Each year the pupils move to a different class,...
5
by: David Deacon | last post by:
Hi i was given the following advise,below my OriginalQuestion I am a little new to ADOX can you direct me to the following Do i place the code behind a button on a form? Or do i place it in the...
2
by: deko | last post by:
This may be an easy question, but for some reason the multiple table design idea is throwing me. I'm trying to avoid using one large, wide table - so I've got multiple tables that hold different...
8
by: Nhmiller | last post by:
How is that done? Thanks. Neil Cat Paintings At Carol Wilson Gallery http://www.carolwilsongallery.com
7
by: Michael Deathya | last post by:
Hi, I am pulling over 400 different metrics from an Excel spreadsheet into Access (97). Conceptually, each row represents a single set of these 400 metrics. However, because of the 255 column...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
7
by: david | last post by:
I have asked this question before. But it does not work for me. Given radion buttons in the web form design page. What I did is described as follows. A panel control is dragged into the design...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
4
by: yanjie.ma | last post by:
Hi, I've got a two part question on table and form design (sorry for the length but it takes a bit to explain). Our sales department uses a look-up table to help the them select the best...
4
by: Deus402 | last post by:
Here is my table design: tblEmployers EmployerID autonum (primary key) EmployerName text tblLocations LocationID autonum (primary key) EmployerID longint (foreign key) LocationAdress text
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.