Hay all,
I need to construct a very complex student/coach/time/day Database.
Every student can attend a lesson twice a week, on a particular day and time with a particular coach.
Every coach has his/her own time table (Days available, times available on those days).
So I want this effect on a form:
Day: Monday
Coach: Jack
Time: 10:00
So Coach is dependent on Day, Time is dependent on BOTH Coach and Day.
I got the first one working but I am stuck on the second.
I created a Table for every day of the week (Mon through Friday) and have each coach's name as the "header" of a column, in that column I have the times they are available:
Code:
Code:
Jack - Roy
08:00 - 09:00
08:20 - 09:20
08:40 - 09:40
In my form, in the event procedure of the second list box I have the following:
Code:
Code:
Select Case [Swimming_Day_1]
Case "Tuesday"
[Time_1].RowSource = "SELECT [Coach_1].Value " & _
"FROM [Tuesday Times] "
End Select
But now when I select for example "Jack" in the "Coach_1" List box, the "Time_1" list box lists 3 entries of "Jack", not "08:00, 08:20, 08:40" respectively.
How can I accomplish the above without having to create a separate Day/Times Table For each and every coach (There are 8 coaches and 5 days, and I want things as easy as possible to update coaches should there come extra or some leave maybe).
So in summary:
Under the "office use" tab:
Swimming day = Fixed source: monday through friday.
Coach 1/2 = Dependant on day in Swimming day 1/2, from "coaches" table check boxes. (This is also an issue I still have to resolve as it is hacked from "coach days" but that needs to change)
Time 1/2 = Dependant on coach and Swimming day, gathered from *day* Times (eg Tuesday Times) table.
For example if:
Swimming day = Tuesday
Coaches = Christine, Devin, Ezanda. - Select Christine
Times = 9:00, 9:20, 9:40, 10:00. (From Tuesday Times).
All of this is working towards having a localized schedule for the swimmers and their coaches. A ground work for moving all the separate parts of the current system to a localized database with all the information in an easy to access and maintain database.
I hope what I am trying to accomplish is clear. I have been trying to get this to work for over a week now. No google or youtube yielded any usable results.
I will include a clean database so you can see what I have at the moment, please bare with me since this is my first real in depth attempt at access and VBA at all. So most things are hacked together from code I found through google magic.
I realize it might need a lot of cleaning up, but I really need to get it functional first.
Thanks in advance.
EDIT:
I am working on 2010, but the computer where this will be used is still using 2007, if that would make a difference.