I want to make an appointment manager type thing in Delphi. In which I can add/edit/delete/make sure appointments dont clash.
Its part of a larger program I am making in Delphi which is why I cant use anything else (apart from microsoft access via a DBGRID) and it is really confusing me!
Does anyone have any ideas to get me started? I mean what components I should use? Im slightly experienced in delphi but not experienced in linking/using it with other programs.
The only options I can think of...
1) use the DBGRID and the DBnavigator components, linked to an access database, but I dont know how to check for clashes or how to say editbox.text := row 1, column 4 in the dbgrid (as ild also need to be able to do that).
2)I have heard you can alter the Calender component (Tmonth calender) to take multiple appointments but yet again I cant seem to work it out.
3)Perhaps link it up with a calender from another program (e.g microsoft outlook) but I would need advice as to how to do this.

I have tryed for ages to do this, and would really appreciate any help/advice to get me started.

8 Years
Discussion Span
Last Post by delphiman

As always this is a logic issue not a delphi issue.

As a human, how would you tell if "day shopping - 11am-6pm 19th Dec" clashes with "dentist - 4pm 18th Dec" or "Joe coming for dinner - 5.45pm 19th Dec" ?? (these appointments are ficticious as I could never ever spend that much time shopping, hate it)

the TCalender component does, but not in the way you probably think. It doesnt work like MS outlook and so on.

TMS have a few components that would go to make an outlook style appointment thing which simplifies the whole display element.

As for adding an edit box to your grid - its covered in multitudes of tutorials. Have a google.


As for adding an edit box to your grid - its covered in multitudes of tutorials. Have a google.

I have tried google, and searching through many sites on this type of thing =(. Maybe its because I dont exactly know how to word it, but there doesnt seem to be anything about what I want to know. I have an edit box on the form I just dont know how to take the text from that and transfer it to a specific row and column in the dbgrid.
I know I need to say 'if appointment2 on day1 clashes with appointment1 on day1 then show message saying clash' but I dont know how to implement that with the calender. Or how to make appointments at all with it. Thanks for replying by the way, like I said Ive tryed google and everything I can think of including numerous books to no avail so im grateful for your help.
Oh and.. Maybe this is a silly question, but is TmonthCalender the same component as Tcalender?


If you want to put it in a cell of a dbgrid, you'd change the db entry.. But your original post implied more of inserting a component into a dbgrid which is of course on google by the ton.

You didnt answer how YOU as a human would work it out - the answer is the same with the computer, you just need to write it down. The computer has no concept of calender, only humans, so you need to explain to it how you want it to work.


After weeks I finally managed to get the editbox problem to work! I just sort of reversed the code (the one thats easily found on google) for putting a cells data into an editbox and then changed the datasource to allow me to edit it from the editbox. =)!
But I still have the problem with the calender. Is TCalender = TmonthCalender? Because I have TmonthCalender and it seems useless apart from to choose a date, I cant see how Ild store appointments. Especially to make them last after Ild closed the program.
As a human? Ild realise that 10am-6pm saturday clashes with 4pm-8pm saturday because the second one starts before the last one finishes but after its started...


Well then, as a human you need to write that down in an if statement for the computer.

A little like the "Does this glass need topping up?"

If person has glass, and glass < full and they want more, add till glass = nearly full.

each appointment has 2 specific fields of interest, start and end. Your statement covers those - ergo you can solve that one.

Dont have delphi to hand but I believe you will find that is really all the calendar component in delphi is for, picking dates - there are 2 but they are pretty much the same. I drew my own once made a TYearCal which had data behind it to shade days and so on.


I am not certain I understand what you are asking. That is to say what level of experience you have with programming in general. You mention using DB related compnenets, but it is not clear if you understand (yet) how they work There are several excellent tutorial sites: Delphi.about.com has a great deal about database component use with example code that will either show you how or fill in gaps in your understanding depending upon your needs and understanding. Another good site for getting a good base in Delphi programming is at 30 Camtasias area in Nick Hodges site http://blogs.codegear.com/nickhodges.


I'm not sure I understand your problem but it seems that you need to rely on your database table structure to create what you want.

For instance of you were to use Delphi Desktop to create a Paradox table you could Index the Appointment Field and have the the Date field as a Secondary Index.

Having done that you will get a "Key violation" if you were to attempt to duplicate any entry where [say] "Joe Bloggs" is entered TWICE in the Appointment field as having been appointed on [say] 01/11/2008.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.