Hi,
I'm basically looking for advice on the programatic design of a ArrowsCalendar I want to include in a booking system for a small hotel. (For example, how the variables should be organized, how to split up the different functions, etc - basically advice on how best to go about making it.) Thank you in advance for any advice!
ARROWS CALENDAR
***************
The center of the database application, will be the ArrowsCalendar, which will look much like the attached Capture_DrawingboardCalendar.jpg (which is a drawingboard draft, se below for details). I've organized the whole db in the following tables:
* Bookings [ContactID, RoomID, SlotID, SignedID, TypeID, StatusID]
* ContactList [(div contact infos)]
* RoomList
* Slots [INdate, INtime, OUTdate, OUTtime]
* etc...
* Then pop-up forms for reports, inputs, etc.
* Main form CALENDAR with subforms for each row/room.
* Subforms for each room, where arrows are drawn.
The idea is that for each booking made (thru a form), all the ID's and their respective "owner" tables will be updated, and the Bookings ID will contain all the info about the booking, incl. exact time-slot, status-codes of booking, etc.
With this, I'm thinking to make the mentioned ArrowsCalendar (Capture_DrawingboardCalendar.jpg).
To explain the draft-drawing a bit:
* rooms vertically, dates horisontally.
* arrows indicate status by color (eg. green = checked-in, grey = checked-out, yellow = reservation, red = due to check out today, green shaded = due to check in today, yellow shaded = reservation not confirmed.)
* arrows also indicate length of stay, incl. check-in/out time/date (by position of tail, body, head of arrow)
* so for example, @ room 103, the last guest has checked out (grey, arrow ended early morning), and the current guest has checked-in and is due to stay a week (green, head ending on date seven days ahead).
* another example, @ room 111, the last guest has checked out (grey), but the next guest has yet to check in (green shaded).
The UI functionality I'll implement is drag-and-drop, drag-and-resize, dbl-click for edit reservation, plus have some ID info (eg. guest name) appear in the body of the arrow.
The way I'm thinking to set it up, is, first of all,
since there is no arrow shape in Access, make the arrow a composite of tail + head as image, and body as colored box.(See Capture_ArrowComposite.JPG.) Then, a DrawArrow() function, which can be called upon with full list of arguments, to simply draw an arrow where it is asked, with included update of Events and RecordSource (or whatever) of arrow-objects. Then, to establish the position of the arrow, to (preferably) make a query with calculated fields to narrow down every arrow for every room row over all dates. ("Preferably," because the user will be able to scroll thru weeks into future and history in the calendar, with updated arrows, such a large and flexible dataset that it seems more functional to store the information in the database and call upon those values, rather than having to calculate it every time when changing week-view in the calendar.(?)) Then this being made to draw or refresh thru some function matching the query/table values of 'coordinates' for a given date/week with the DrawArrow() function. (Which can be added in OnLoad() or other Events in main form.)
There are also immediate subproblems, or headaches:
* When there are several bookings on same room, same day (which happens surprisingsly often), the arrows will have a 'natural' size of no more than the tail-image of which it is partly composed. This will either place the three arrow-objects (tail(image), body(access form box), head(image)) on top of each other, or somehow notice that they are overlapping and take proper measures.
* Similarily, when there are double-bookings, where arrows 'naturally' should be placed on top of each other, the functions (or query?) should notice the double-booking and create a response. So, either create a function in DrawArrow() to draw the arrows with conditions of relativity to other arrows / So, perhaps, create a function to order arrows to be drawn with conditions of relativity to other arrows? What I see, in fact, is a Function reading from coordinates calculated in queries, processing those coordinates based on relativity to each other, and order appropriate arrows to be drawn thru eg. DrawArrow().
Another issue is the number of images in each subform. Each image/arrow should be 'imported' only for the current draw, so the form wont be cluttered with visible=false arrows, or something. (Is there a way to create or copy images to a subform easily?)
I'm unsure about which approach to make in terms of how much energy they take, how realiable they are, and so forth - and would really appreciate some input towards which path to take, and some good judgements on the bigger lines of this pet grown monster project.
Hoping for some good input, thanks again!