Full Version: More Calendars
UtterAccess Forums > Microsoft® Access > Access Forms
adamsherring
Hello all,
I'm searching for a calendar control that will allow me to reference each specific date control object (ie, if the control holding the number '14' in the date is a command button, I want to be able to reference its properties)
I'm trying to avoid having to build my own, so any help would be appreciated.
Another caveat is that I don't have admin access to my machine, so I can't load any DLL's.
And, if you're wondering, the goal of this is to combine a daily schedule and a monthly view into something that will quickly tell you if you've got something going on today, tommorow, or next week (etc..)
Any and all help will be appreciated.
Adam
adamsherring
Ok, I went and built one myself.
I'm attaching a rough draft to this message in case anyone has ever wanted something similar. Any comments or insights are always appreciated. There are no comments to be found, unless they're notes to myself, and nothings been overly streamlined just yet.
If you download it and want to test different dates, open up the scheduler table, and add the name of the table, name of the date field, and the colour constant used to represent it. Multiple hits are OR'd together.
The idea of this is to have a calendar view that will highlight days where there are activities of some sort. Double-clicking one of these days will open up a daily report telling you what needs to be done (that's not implemented).
I've tried to keep this nice and modular, so f this helps anyone, great. If it doesn't, at least I enjoyed doing it.
Hope to help,
Adam
Troulcortex
This is pretty cool! The calendar controls I had to use are crappy date selectors. If you keep this up, I'd be interested in updates.....
Gabe
adamsherring
Ok, I have another version ready.
Ok, here's how to modify stuff :
There are two dates tables, FirstSet and SecondSet. They contain a date field and a description. Simply add more dates & descriptions there.
The scheduler table contains the metadata. The names of the tables to look in, the names of the fields within the tables, the resulting colour, and the name of the subform to use.
In the Calendar module, there are two lines :
Public Const sMultipleSummaries = "frmC"
Public Const sMultipleDateField = "Dates"
this is where you set the subform to display if there are multiple tasks listed in that day.
The subforms are basically summary forms to show all the data for the day. Simply create a subform using whichever as a recordsource, containing whichever fields you want (but the datefield listed in the Scheduler table must have the same name), and place it on the myCalendar form.
What will happen is when the mouse is moved over a square, it will check to see if there is stuff listed for that day, then check which subform to make visible, then show it and filter it. Multiple hits will use the form listed under "sMultipleSummaries"
The reporting function is not yet implemented, but will work in the same way as the subforms, except with a double click. The form will figure out which report to load, load it and filter it.
Odon't remember how many other things are different from the last version I uploaded.
There are a few extra modules of mine that are incorporated in here; not all the functions were used, but its just easier to load the whole module than to pick and choose the functions.
It was running a little slow on my computer, but I suspect earlier crash-related memory leaks were to blame.
Again, questions, comments, and direction are always appreciated.
Thanks to all who download,
Adam
tpitman
Hi,
Is this available for 97 (ver 8.0)?
tpitman
Ok, I've managed to covert to 97.

Each page on my form is based on a single date (not continuous form). I have managed to use your excelent calendar to sync with each page.
.e. If I click on a date on the calendar, the appropriate day's schedule is shown.
A couple of questions.
How can I do this the other way around.
Let me explain. I have a subform which shows dates of any future schedules entered. If I click on the button next to a date, again the date is syncronised with the main form.
If, of course the date shown is in the next or subsiquant months, then I would like the 'calendar' to jump to that month.
Even better, would be for the calendar to sync with the 'Date' with perhaps a font colour change for the shown date. I know that I'm asking a lot, but is it also possible for the calendar to show the current date, again using a differnt font colour or bold text?
RuralGuy
Adam,
Nice coding. Thanks for posting your work.
tpitman
Hi,
I have now managed to 'colour' the current date on the calendar, but would appreciate any help on syncronising calendar with the schedules date shown if possible.
lso, by default, the calandar week starts on a Sunday, can this be changed to Monday?
I have attached a screenshot of what I have done so far.
Many thanks for all your help.
tpitman
Wow, I've now managed to snyc the calendar with the Schedule date.
I have been unable to change the week start day from Sunday to Monday though.
any help would be great!
adamsherring
Hey guys -

Sorry I haven't responded to any of the questions, I kinda forgot about this original post of mine.
To change the beginning of the week from sun to mon isn't quite automatic. I think I took it for granted that people would want sunday first.

Ok, I went and figured it out and fixed it up real nice. Since I saw that you did some heavy editing, I'm just going to post the code that I changed to get that working, instead of uploading the db again.

in the myCalendar module, i pladed :

Public Const myCalWeekstart = vbsunday

this will tell the calendar which day you want the week to start with. You would choose vbMonday.

In the createCalendar function,

you'll see these lines :

CODE
    If ndayCount = 1Then ndayCount =8
nbsp;       
    dCalMonth = DateAdd("d", (ndayCount - 1) * -1, dCalMonth)


change them to this

CODE
    If ndayCount = myCalWeekstart Then ndayCount = myCalWeekstart + 7
    
    setDayLabels
    
    dCalMonth = DateAdd("d", (ndayCount - myCalWeekstart) * -1, dCalMonth)


then you need to put a whole new function in.

CODE
Public Sub setDayLabels()
    Dim sDayAbbr(7) As String
    Dim sLabel As String
    
    Dim x As Integer
    Dim count As Integer
    
    sDayAbbr(0) = "S"
    sDayAbbr(1) = "M"
    sDayAbbr(2) = "T"
    sDayAbbr(3) = "W"
    sDayAbbr(4) = "T"
    sDayAbbr(5) = "F"
    sDayAbbr(6) = "S"
    
    x = myCalWeekstart - 1
    
    Do While count < 7
        sLabel = sLabel & "     " & sDayAbbr(x)
        x = (x + 1) Mod 7
        count = count + 1
    Loop
    me.label162.caption = slabel
End Sub


Oapologize for the name of label162 - apparently I didn't notice it. Feel free to rename it and you can reference it properly frown.gif

This will keep the day headers in line with the real day names.

I will post another version soon, as I also have a legend that build itself on the fly that might be useful.

Adam
tpitman
Brilliant thanks!
ljforte
I downloaded a calendar from this website and I changed the size of the calendar from the report database view menu. I need to change the size back because the print preview is off. I'm not sure what to change it back to and the more I change it the more messed up it gets. Please help.
adamsherring
Well, which calendar did you download, and why can you not just download it again?
nd, im not really sure what you mean by changing the size of the calendar from the report view menu.
More details will help,
Adam
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.