Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Anyone Create Code to Do the Following?

Status
Not open for further replies.

tfayer

Technical User
Aug 4, 2002
41
US
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 think that you have some good ideas here. The thing is, most post's on tek-tips, that I see, usually don't include this many separate ideas. It will be really hard to walk through this and help you. I only say this because it looks like you have a good idea going here.

What you might want to do is start isolating your major problems, and look at them in a way that is separate from your main idea. Then post a question on how you can accomplish these more simpler goals.

I think that you might not be able to get all of this "overlaping" in a form, but if you do create a report, you can set the properties of the text boxes up so that they are located anywhere in the report. By doing that, for scheduled functions that overlap, you will see the text boxes overlap- if their time coressponds to the left, and top properties. You can set the background color of the text boxes to whatever you want. When the report is printed, the colors will blend on overlapping text boxes.

Reports aren't as fun, if you want to be editing data as you view it. Unfortunately, sometimes they are the only solution. I write code in cuneiform, what about you?
 
markphsd,

Thankyou for your suggestions. I'm not sure what cuneiform is. I've heard of an OCR called Cunneiform but, thats it. Can you inform me on what it is?

Thanks
 
Cuneiform is a ancient wedge shaped writing method used far before biblical times. The only thing I know about cuneiform is that Gilgamesh was written in cuneiform. An excellent book.

Moving into OCR, I don't use it much. In fact, I've never used it, but I do know what it is. Does it somehow apply to your question? If it does, I missed something big. OCR is just something you'llhave to read up on. I'm sure there's a lot of different software for it out there. I write code in cuneiform, what about you?
 
oh, sorry.. i forgot my tag line is "i write code in cuneiform"
I guess that made things confusing. I'll fix it. I write code in cuneiform, what about you?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top