Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Code Archive _ Ms Outlook Style Calendar For Access Projects

Posted by: Peter Hibbs Jul 10 2011, 08:51 AM

The attached A2003 database file demonstrates a calendar form which is designed to simulate (as much as possible) the Calendar facilities in MS Outlook.
It can be used in three modes, Monthly, Weekly (see screen shots below) and Daily and allows users to enter appointments in any mode and to be able to easily switch between modes at any time.
It also has facilities to export appointments to or import appointments from MS Outlook, find scheduled appointments, print a monthly calendar, etc and it can be easily configured for different appointment time slot periods, different formats and so on.
A comprehensive PDF document file is included to show how to set up the system in an existing database project and how to configure the code for your different requirements.
It has been tested on Windows XP and Windows 7 and Access 2003/2007 (but not A2010).
If any bugs found please let me know and thanks to various UA members that have suggested amendments to version 1 which had been posted to this forum earlier.
Peter Hibbs.
(previous file download count: 879, replaced with Version3) ( 771.84K ): 2855 (in post #2 below)

This post has been edited by jleach: Sep 7 2012, 10:14 AM - Reason for edit: Replaced previous with Version3
Additionally edited by Cybercow: Dec 22 2012, 12:36 AM - Reason for edit: Added link to post #2 below for Access 2010 64 bit version


Posted by: dlathem Dec 17 2012, 05:10 PM

Hello again,
just wanted to leave a note for anyone that is using this on a 64-bit office 2010 system. I was running into an error "Please review and update Declare statements and then mark them with the PtrSafe attribute". I found that if you put PtrSafe right after the Declare statement it will eliminate this error.
And here's the 64 bit Access 2010 version tested and working! < (will work ONLY in the 64 bit version of Access 2010) ( 874.42K ): 1269

Posted by: Peter Hibbs Dec 22 2012, 04:40 AM

Hi dlathem,
Thanks for the Calendar update for 64 bit Access, I am sure it will be useful for some users.
I haven't got this version myself but looking at your amendments it seems that it is only the API calls that need to be changed for use with the 64 bit version of Access. I am thinking that we could just add those declarations to the 32 bit version and then Rem them out so that anyone wanting to use the calendar with the 64 bit version could just un-Rem them or maybe there is some way for the start up code to detect which version of Access is being used and enable the appropriate declaration code automatically (or is it more complicated than that?). I will have to think about it some more.
If you have any thoughts on this then please let us know.
Peter Hibbs.

Posted by: DatabaseMN Jan 5 2015, 04:52 AM

Peter, I have worked with your calendar in the past and it is a very nice tool.

I have wondered about why each time I open it or switch views, there is a rapid series of flickering. Is this just my machine or has this come up before?

Have been meaning to ask over the past couple years, but finally got around to it.

Thanks again!!


Posted by: Peter Hibbs Jan 5 2015, 06:58 AM

Hi Dana and thanks,

Yes, it is a nuisance. I am pretty sure it is because of the Conditional Formatting on the date fields and I don't think there is any way of eliminating it and I have tried various methods (unless anyone else knows differently).

Peter Hibbs.

Posted by: jenotc Jan 6 2015, 05:26 PM

I get error message.

Could anyone help on that?

Error message says:

Syntax error in date in query expression `#2015.1.7 10:00`.



Posted by: Peter Hibbs Jan 6 2015, 06:12 PM

Hi jenotc,

This is because your date format is different than the UK or US. Try the attached version below to see if that fixes the problem.

Peter Hibbs. ( 234.19K ): 527

Posted by: EvilBert Mar 23 2015, 12:09 AM

Hi Peter,

Thanks again for posting this awesome calendar.

I have one question.

I've embedded the frmCalendarMain into another form (so now it's a subform), and everything works great except when clicking on day in the calendar. I get an error on; Call Forms("frmCalendarMain").CheckMode. Because my form structure is now "frmSwitchboard!frmCalendarMain" the reference doesn't work anymore.

I've tried changing the reference to point it to the right place, but not having any luck so far. Maybe I'm overlooking something obvious.

Can you advise how I need to change this to reflect that frmCalendarMain is now a subform in my frmSwitchboard form?

Thanks in advance.

Kind regards,

Posted by: Peter Hibbs Mar 23 2015, 09:37 AM

Hi Michael,

Hmmm.. good question. Probably like you I tried changing the reference to the parent form by adding the name to the reference but I could not get it to work, maybe there is a limit on the number of forms a CALL function can be nested.

Anyway, the way round it is to move the CheckMode sub-routine to a Code Module (I used modCalendarCode) and then pass the main form object reference to the sub-routine so that the various commands in the sub-routine can make the required changes. Actually I think this is a better way of doing it as I never liked calling a form's sub-routine form another form.

For the calls from the main form (frmCalendarMain) you can just use the Me parameter and for the calls from the three sub-forms you can use Me.Parent. In the sub-routine itself you would simply replace the Me words with frm which is the alias used for the calling form. I have made the required mods in the demo file below so that you can see how it is done. To find the updates just search the VBA code for ### which I used to mark the changes made. One other change you may need to make is to make sure the Name property of the main sub-form (which was the original main form but is now a subform) is set to frmCalendarMain, otherwise the report title does not work (if you are using the report option).


Peter. ( 165.91K ): 813

Posted by: robertocm Jan 8 2017, 01:26 PM

Dear Peter,

Many Thanks for your calendar and also for the detailed guide 'Outlook Calendar Demo Manual'

Let my just show my gratitude sharing a little 'exercise' of adapting some of your code to an excel week calendar connected to an Access table (instead of the original Access form).

I have used the attached files to try to learn something about date and time queries, crosstab queries and ADO
from my beginner perspective
don't expect any comparable tool

Kind Regards ( 74.09K ): 218

Posted by: Peter Hibbs Jan 9 2017, 06:56 AM

Hi Robertocm,

OK, interesting idea, perhaps someone will find it useful.

Peter Hibbs.