Design Help

Acropolis

Registered User.
Local time
Today, 09:34
Joined
Feb 18, 2013
Messages
182
If this isnt in the right place could someone please move it to the right place.

I am building a system for a local charity group I am chairman of, we assist the local emergency services and civil authorities during times of bad weather with the use of 4x4 vehicles, we use them to get nurses/doctors/paramedics etc round.

The system I am building is a membership database and incident system so that when we receive calls we can dispatch them to the responders quickly and easily through email etc, that part I have no problem with.

The section I am working on is the availability of the responders, I want them to have a section where they can update their availabiltiy each week, so we know who we have available and who isnt.

The tables are hosted on an amzon rds server in mysql, and my plan is to make a little web page that the responders can log into from our website and update their availability through there. The controllers will then have access to the system I am making in access to see who is available and when etc, but we also need to be able to enter this information through the access system for those that dont go online as not all of them do.

There are 4 times slots each day that I need to know availability for, 0000-0800, 0800-1200, 1200-1800, 1800-0000, and there are 3 availability types, available, unavailable, limited.

The way I have the table set at the moment is

ID : MemberID : AvailableDate : Timeslot1 : Timeslot 2 : Timeslot 3 : Timeslot4

With MemberID a forgien key to the members tables and the timeslots with forgien keys to the availlability type table.

Would I be better off creating a seperate table for the time slots, and just having the availability table as

ID : MemberID : AvailableDate : TimeSlotID : AvailbilityID

Therefore having 4 entries in the table for each member for each day, making 18 entires each week for each responder?

The question is 2 part really, that been the first part, the second been, on the form to enter the data, I have the days listed down the left hand side with the date next to them, the date is set when they select the week they want to enter the data for. Then the 4 timeslots across the top, with a combo box for each timeslot for each day with the availability options in them.

Other than writing a seperate sql insert command for each one, I know there must be an eaiser way to insert all the data into the table, but I am not sure how, I am fairly new to access and whilst I have done some stuff, that is a little beyond me at presnet.
 
The second way is better for overall development of the db although the first way is easier from an input point of view:

ID : MemberID : AvailableDate : TimeSlotID : AvailbilityID

However this can be done in a number of ways:

1. As you have it where AvailablilityID is a FK to a small table of available status's - eg. Available, Holiday, Sick, 2 Hrs notice, etc so each timeslot needs to be completed.

2. Similar to 1, but instead of AvailabilityID, simply have a yes/no Available field

3. Do not have the availabilityID field and only include records where the person is available.

With regards inserting (or amending) the data I would look to create a sql command after each update if date/timeslot. This can be done in a number of ways depending on how you want it to work - you should just need the one routine which is called after each update event providing the date and timeslot as parameters

1. SQL delete (which won't generate an error if the record does not exists) followed by a SQl insert
2. If you know the record already exists then use a SQL update or if you know it doesn't exist use a SQL insert
 
I posted a sample database that should help you design an interface you like. I call it a "Bound Denormalized Form" because it uses properly normalized tables and makes them look like a spreadsheet. It will be perfect for your dilemma. You can use either time slots or week days as the columns and the other dimension as the rows.

http://www.access-programmers.co.uk/forums/showthread.php?p=1284048#post1284048
 

Users who are viewing this thread

Back
Top Bottom