BRIEF DESCIPTION OF THE PROBLEM: Trying to create an appoinment scheduling program and running into a problem if on a given date there are two or more appoinments that have some overlapping time between them. If there is only one appoinment during this time, display the data in colored textboxes the full width of the subform displaying the days appointments. If there are 2 appointments that overlap either fully or partially, display the data in two colored textboxes split evenly over the width of the subform displaying the days appointments, and so on for increasing number of overlapping appointments(3 Columns for 3 overlapping appointments, 4 Columns for 4 overlapping Appointments). Using my method, described below, I need code to carryout the above. OR, IF ANYONE HAS A BETTER WAY, I WOULD GREATLY APPRECIATE YOUR INPUT.
I am trying to create a scheduling database similar to outlook or ACT. What I have done so far is created a calendar which allows the user to select the date they want. This date inturn makes 3 subforms, sfrmDayView, sfrmWeekView, sfrmMonthView, display data for the date provided to its module through the Public Variable varDateSelected.
The Appointment Info is stored in tblAppt with Fields Date, cdeTime, cdeDuration, typAppt, txtDescip, txtDetails all receiving data from frmApptSched(used to simply supply Appointment Info). For cdeTime and cdeCode I have simply numbered all times sequentially, starting at 12:00 AM Midnight, in four didgit format. So mindight would be 0000.
An appointment at 1:00 AM lasting 30 min would therefore be cdeTime=0060 and cdeDuration=0030.
Now on my sfrmDayView, I have created 96 labels containing the time from 12:00AM to 11:45PM at 15min Intervalsdown the left side of the form. Next to each label I have created four textboxes named in the following way: 5 digits - the first digit is the number of the column, 1-4; the next four digits are the cdeTime equal to the cooresponding Time displayed in the label. So for 1:00AM there would be four textboxes created in that row named, 10060, 20060, 30060 and 40060. All textboxes are set to Visible=False. When a date is selected that contains an appointment, say 1:30AM for 1Hour, code tells TextBoxes named (10090, 10105, 10120, 10135)(20090, 20105, 20120, 20135)(30090, 30105, 30120, 30135)(40090, 40105, 40120, 40135) to become visible and turn a certain color corresponding to the appoinment type. I have not yet created code to display the text info, txtDescrip and txtDetails. I first have to solve the following problem:
When this is the only appointment within the time range 1:30AM to 2:30AM it is fine to make all four columns, a total of 16 textboxes, devoted to this appointment. However, if there are two appointments taking place at this same time on the same date, I want to assign the first two sets of textboxes(named 10090, 10105, 10120, 10135 and 20090, 20105, 20120, 20135) to one of the appointments and the last two sets of textboxes(named 30090, 30105, 30120, 30135 and 40090, 40105, 40120, 40135) to the second appointment. Since they are different AppointmentTypes they would be different colors(and obviously when I get to it contain different text). To through in another twist, it is not only when the times match but if only one 15min block overlaps of 2 separate hour appointments, I need each appointment to occupy 2 textbox columns each. And if 3 separate appointments overlap I need it to use 1 textbox column for each appointment(I know this will not evenly distribute the appoints across the four columns but that is fine for now) and the same if there are four separate overlapping appointments, I need each appointment to be assigned to 1 textbox column each. This limits to a max of four overlapping appointments but I think that is plenty.
So, put more simply I need code that will determine if there is any appoinment overlap on a given date, determine how many overlapping appointments there are within a given range(either 0, 2, 3 or 4) which also determines the number of separate "Visible Appointment Columns" needed for each appointment(ie. 0 overlapping appts, but there is 1 appointment = 1 "Visible Appointment Column" made up of all four textbox columns; 2 overlapping appointmenst = 2 "Visible Appointment Columns" made up of two textbox columns each; and so on for 3 and 4 overlapping columns), then assign each separate appointment to a "Visible Appointment Column."
Does any one have any ideas? Or, does anyone have any better ways of creating an appointment scheduling databse?
Any and all help is GREATLY APPRECIATED!
Thank you.
I am trying to create a scheduling database similar to outlook or ACT. What I have done so far is created a calendar which allows the user to select the date they want. This date inturn makes 3 subforms, sfrmDayView, sfrmWeekView, sfrmMonthView, display data for the date provided to its module through the Public Variable varDateSelected.
The Appointment Info is stored in tblAppt with Fields Date, cdeTime, cdeDuration, typAppt, txtDescip, txtDetails all receiving data from frmApptSched(used to simply supply Appointment Info). For cdeTime and cdeCode I have simply numbered all times sequentially, starting at 12:00 AM Midnight, in four didgit format. So mindight would be 0000.
An appointment at 1:00 AM lasting 30 min would therefore be cdeTime=0060 and cdeDuration=0030.
Now on my sfrmDayView, I have created 96 labels containing the time from 12:00AM to 11:45PM at 15min Intervalsdown the left side of the form. Next to each label I have created four textboxes named in the following way: 5 digits - the first digit is the number of the column, 1-4; the next four digits are the cdeTime equal to the cooresponding Time displayed in the label. So for 1:00AM there would be four textboxes created in that row named, 10060, 20060, 30060 and 40060. All textboxes are set to Visible=False. When a date is selected that contains an appointment, say 1:30AM for 1Hour, code tells TextBoxes named (10090, 10105, 10120, 10135)(20090, 20105, 20120, 20135)(30090, 30105, 30120, 30135)(40090, 40105, 40120, 40135) to become visible and turn a certain color corresponding to the appoinment type. I have not yet created code to display the text info, txtDescrip and txtDetails. I first have to solve the following problem:
When this is the only appointment within the time range 1:30AM to 2:30AM it is fine to make all four columns, a total of 16 textboxes, devoted to this appointment. However, if there are two appointments taking place at this same time on the same date, I want to assign the first two sets of textboxes(named 10090, 10105, 10120, 10135 and 20090, 20105, 20120, 20135) to one of the appointments and the last two sets of textboxes(named 30090, 30105, 30120, 30135 and 40090, 40105, 40120, 40135) to the second appointment. Since they are different AppointmentTypes they would be different colors(and obviously when I get to it contain different text). To through in another twist, it is not only when the times match but if only one 15min block overlaps of 2 separate hour appointments, I need each appointment to occupy 2 textbox columns each. And if 3 separate appointments overlap I need it to use 1 textbox column for each appointment(I know this will not evenly distribute the appoints across the four columns but that is fine for now) and the same if there are four separate overlapping appointments, I need each appointment to be assigned to 1 textbox column each. This limits to a max of four overlapping appointments but I think that is plenty.
So, put more simply I need code that will determine if there is any appoinment overlap on a given date, determine how many overlapping appointments there are within a given range(either 0, 2, 3 or 4) which also determines the number of separate "Visible Appointment Columns" needed for each appointment(ie. 0 overlapping appts, but there is 1 appointment = 1 "Visible Appointment Column" made up of all four textbox columns; 2 overlapping appointmenst = 2 "Visible Appointment Columns" made up of two textbox columns each; and so on for 3 and 4 overlapping columns), then assign each separate appointment to a "Visible Appointment Column."
Does any one have any ideas? Or, does anyone have any better ways of creating an appointment scheduling databse?
Any and all help is GREATLY APPRECIATED!
Thank you.