Calendar Maker, small Ms Access Gurus

CalendarMaker for Microsoft Access Reports

Create calendars as Microsoft Access reports or PDF files. Specify month and year, number of months, first day for the week. Calendars display in the language defined in your Windows Region settings. Print however many months you want, such as 12 for a full year, on one or more pages depending on number of months and calendars per page. Show data from your queries. Open calendars in Access, send to printer, or create a PDF to show in a PDF reader or a web browser.

Use queries to show additional information such as holiday names and other calendar data from your database such as appointments, birthdays, schedules for your favorite sport or the ballet! whatever you want to see.

Create a Title to specifically describe displayed information.

There is lots of sample data for you to play with and get ideas from! Look at the sample queries to see how they're done, and read the Query Fields section. Turn your date-dependant data into easy-to-read calendars!

All you need to incorporate these calendars into your application is 4 modules. Calendars are scaled and positioned by VBA. There can be one or many per page.

So, you don't need this database to use the CalendarMaker! The download database has a form to make it easier to launch various calendar reports, and different report examples have VBA to position calendars, and loop, if there is more than one per page. However, you can just import the modules you need into your application, and put the logic you need into the code behind your reports.

Quick Jump

Draw Calendars on Access Reports using the free CalendarMaker

Goto Top  

Calendars with Holidays in different languages

Videos

CalendarMaker presentation to AccessUserGroups, hosted by Dale Fye

YouTube: CalendarMaker presentation to Access User Groups (49:05)

Access DevCon 2020, hosted by Karl Donaubauer and Peter Doering

YouTube: CalendarMaker and Document SQL at Access DevCon 2020 (15:03)

RowSourceType Callback Function

YouTube: RowSourceType Callback Function in Microsoft Access (12:33)

Goto Top  

CalendarMaker

The CalendarMaker is written in VBA and runs in Microsoft Access. It uses Report .Line and .Print methods to do all the drawing and writing. Calendars can be scaled and positioned, so you could show multiple calendars on each page.

The default report type on the menu is full-page calendars, but you can choose something else, like multiple calendars on each page in rows and columns, which can be customized. Be sure to open only one calendar report at a time. They all use the same variables.

Calendar

When the CalendarMaker application opens, one click of a button is how fast its possible to get a calendar for the current month that you can print. There could be more information on each day, but nothing was specified. Sometimes this is exactly what you want, so you can handwrite with pencil or pen, and plan or document.

Calendar by the CalendarMaker

Goto Top  

Menu

Calendar Maker menu

Goto Top  

Date

When you open the calendar, the Date in Start Month textbox is set to the current date. You can change the date by entering it, or picking from the floating calendar. The day doesn't matter. The calendar will be created for whatever month and year you choose. Alternately, you can use the Year and Month combo boxes, and type any valid numbers even if they aren't in the list.

Create PDF Files

Create PDF files by ticking the "Output to PDF" checkbox. The default path to save PDF calendars is the \Calendars folder under the CurrentProject.Path, which will be created if its not already there. The file name will be something like "Calendar_Spurs_202001_202012_Day2.pdf", which means the title is "Spurs", for January 2020 (202001) to February 2020 (202002), and the first day for the week for the calendar is Monday (Day2 where 1 is Sunday), Access will automatically open the PDF file for you.

With a little customization, there could be a prompt to save the file wherever wanted.

Number of Months

By default, the calendar report will be one month. You can change this to any number you want. This makes it easy to print a calendar for a whole year.

Title

Title is optional and will appear after the month and year at the top of the calendar. The title, if specified ... first 20 characters (which you can change) ... will also be in the file name if creating a PDF.

Goto Top  

Languages

The CalendarMaker uses the language set in Windows, under the Region settings, for day and month names. To change the language, go to the Control Panel and choose Region. Depending on what you want, you may also need to install a Windows Language pack. English for Canada isn't very different, and seems to use Sunday as the first day of the week, like we generally also do in the United States of America.

Windows Region for Canada

Goto Top  

First Day of Week

If your standard first day of the week isn't Sunday, no problem. Or maybe you just want your weeks to start on Saturday since you're off Thursday and Friday. You can set the first day to whatever you want, for whatever reason.

You can pick any start day for weeks. This list will be displayed in whatever language you have set in Windows. Here are some of the ways that the calendar changes:

French in France:

Weekday and Month Names in French

Spanish in Mexico:

Weekday and Month Names in Spanish

Norwegian

Weekday and Month Names in Norwegian

and back to English

Weekday and Month Names in English

... or with first day of the week set to Monday for our friends across the ocean in the United Kindom

Weekday and Month Names in English

Setting first day was a requirement when I built this tool, along with a more practical example for drawing on reports (than rainbows and pots of gold as was done in the Unit Circle video).

Goto Top  

Query Fields

Holiday and Calendar data Queries

Optionally, you can choose any query in your database with "holiday" in the name, to provide day names that will be printed in the upper left of a day cell. Likewise, any query with "calendar" in the name will show on the list for calendar data queries. If you want to use different trigger words, you can edit the criteria in the RowSource for the combo boxes. The list come from the MSysObjects table, which Access automatically creates. To correlate to the calendar, the holiday and calendar data queries must have the following fields:

Calculated Field name   Data Type   Description   Holiday Query   Calendar data Query
CalYr   Integer   4 digit year
you can use the Year([datefield]) 
CalMo   Integer   month number, 1-12  
you can use the Month([datefield]) 
CalDa   Integer   day number, 1-31  
you can use the Day([datefield]) 
Text1   Text   text to print on day  
Holiday in upper left, Calendar data in middle of day cell 
IsBold   Boolean   True for bold text  

Holiday queries can only have one record for each day, but Calendar data queries loop through all the values. Careful it doesn't get too long though! Text is wrapped between the cell sides, and starts at a certain place, but it can go past the cell on the bottom.

If you needs the height of a week to grow taller as text gets long, try the HTML Calendar Report to create web pages with calendars from Access.

Goto Top  

Holiday Calendar

Here's a calendar in English for December 2019 with American holidays. You could change the qCalendarHolidays_US query to eliminate some of the less-known holidays by adding criteria for the Lev field (Level) and remove anything greater than 3, or maybe 1, depending on what you want to show. The data comes from the cal_HolidayCtry table, which you could swap for your own holiday table.

Holiday Calendar for December 2019

If you show calendar data AND holidays, the font size for holiday names is smaller. This calendar has a title defined to be "Abby's Appointments". Some days have more than one appointment, so text is combined using whatever is your list separator character for Windows. For Americans, this will be a comma.

Holiday and Appointment Calendar for December 2019

Goto Top  

Worldwide Calendars with Holidays

Calendars in different languages for different countries, with holidays. I've entered holidays for 2019 and 2020 for America, and five other countries. The following calendars were created by the CalendarMaker:

English, United States

First day of the week is Sunday

2020: January - December, 12 months

December 2019, one month

Goto Top  


English, United Kingdom

First day of the week is Monday

2020: January - December, 12 months

December 2019, one month

Goto Top  


English, Canada

First day of the week is Sunday, like Americans ... but the holidays are a little different ...

2020: January - December, 12 months

December 2019, one month

Goto Top  


French, France

First day of the week is lundi

2020: janvier - décembre, 12 mois

décembre 2019, un mois

Goto Top  


Spanish, Mexico

First day of the week is domingo

2020: enero - diciembre, 12 meses

diciembre de 2019, un mes

Goto Top  


Norwegian, Norway

First day of the week is mandag

2020: Januar - desember, 12 måneder

desember 2019, en måned

Goto Top  

Import CalendarMaker to another database

CalendarMaker required

To import the CalendarMaker tool into another database, you'll need these 4 modules:
Module mod_CALENDAR_MAKER_s4p
Module mod_Properties_s4p_cal
Module mod_Registry_GetSeparator_Branislav
Module mod_api_GetDeviceCaps_PPI_s4p_cal

+CalendarMaker menu form

If you also want the menu form and the full-page landscape report, you'll need these objects too.
Table cal_NUMBER
Table cal_Reports
Form f_CalendarMaker_MENU
Report rCALENDAR_Fullpage_Landscape


Holidays

optional, for holiday queries
Table cal_HolidayCtry
Query qrHolidays_caEN
Query qrHolidays_FR
Query qrHolidays_MX
Query qrHolidays_NO
Query qrHolidays_UK
Query qrHolidays_US

Optional tables that are nice to have if you're building international applications ... always changing ...

Table cal_Country
Table cal_Language
Table cal_TimeZone

Optional reports for multiple calendars on each page in rows and columns

Report rCALENDARS_Landscape
Report rCALENDARS_Portrait

other optional reports

Report rCalendar_1month_HalfPage_Roses_Portrait
Report rCalendar_3months_Roses_Landscape
Report rCalendars_3monthsPage_Picture_Landscape

Calendar Custom Picture feature

not done, so this will get better
Table cal_PicCategory
Table cal_PicCategory
Table cal_Picture
Form f_cal_PICTURE
Report rCalendar_HalfPage_Picture_Portrait
Module mod_Browse
Module mod_Dir_Exist_Path_PathFile
Module mod_Dir_MakeAPath

Sample: Games and Sports

if you like sports, you'll like this!
Table gamDiv
Table Games
Table GamesTeams
Table gamSports
Table gamTeams
Table gamVenues
Query qGames_REQUIRED
Query qCalendar_Games_NFL
Query qCalendar_Games_Spurs
Query qGame_Team_Ordr
Form f_Game_SPORTS
Form f_GAMES_mainform
Form f_Games_sub
Form f_GamesTeams_sub
Form f_GameTeam_Ordr_sub

Other Samples

Table Orderz
Table Paymentz
Table Production
Table c_Address
Table c_AdrType
Table c_Appointment
Table c_ApptType
Table c_Contact
Query qCalendar_Appointments_Abigail
Query qCalendar_ContactBirthdays_Year
Query qCalendar_Orders
Query qCalendar_Payments
Query qCalendar_ProductionSales
Form f_CalendarMaker_Appointments

Stephen Lebans' tool to save and restore Relationships Diagram

Table tblRelationshipViews
Form frmRelationshipViewsAdd-Modify
Module clsCommonDialog

CalendarMaker modules:

  1. mod_CALENDAR_MAKER_s4p
    specific code not posted yet. Download accdb from http://msaccessgurus.com/tool/CalendarMaker.htm
  2. mod_api_GetDeviceCaps_PPI_s4p
  3. mod_Properties_s4p
    http://msaccessgurus.com/tool/Code/Properties.htm
  4. mod_Registry_GetSeparator_Branislav
    http://msaccessgurus.com/tool/Code/Registry_Separator_Branislav.htm

After importing the modules, be sure to Debug, Compile the code. Save after the project compiles. Alt-F11 to switch to the VBE (Visual Basic Editor)

Goto Top  

Logic

Everything is open, so you can look at it for yourself.

Goto Top  

Download

Download for Access 2010+

CalendarMaker_s4p_230214_3264.zip (4 kb, unzips to an Access ACCDB database file)  

Needs VBA7 to run. Fixed code for 32-64 with the help of Peter Cole, the world expert on this topic. Thanks to Garry for telling me that running in 64-bit didn't work.

Download Peter's Scanner and Viewer (comes with scanner) to find problems and lookup correct syntax for API calls.
https://www.thememydatabase.co.uk/access32to64.html
it's free -- click the Download button and then click Add to Cart in the screen that pops up. There won't be a charge.

Download for 2007

If you're using Access 2007, get this version. Sample data for dates in 2020 or 2021

CalendarMaker2007_s4p.zip (3 kb, unzips to an Access ACCDB database file)  


Download CalendarMaker with Day Color

If you want to download a version where you can specify background day colors in your data, as shown below, go to
https://msaccessgurus.com/tool/CalendarMaker_DayColor.htm

CalendarMaker with day colors

License

This is a regular ACCDB file with source code. It may be used freely, but you may not sell it in whole or in part. You may include it in applications you use yourself, and that you develop to help others. Keep attribution. Use at your own risk.

Remember to unblock the ZIP file, (remove Mark of the Web) before extracting the file(s). Here are steps to do that: https://msaccessgurus.com/MOTW_Unblock.htm

Goto Top  

Reference

Drawing Reference on MsAccessGurus

Report Draw Reference for VBA syntax and help for drawing on Access reports.

Microsoft Help

Docs / Office VBA Reference / Language reference / Reference / Functions / WeekdayName

Help: WeekdayName function

Docs / Office VBA Reference / Access / Object model / Report object / Methods / Line

Help: Report.Line method

Docs / Office VBA Reference / Access / Object model / Report object / Methods / Print

Help: Report.Print method

Docs / Office VBA Reference / Access / Object model / Report object / Methods / TextHeight

Help: Report.TextHeight method

Docs / Office VBA Reference / Access / Object model / Report object / Methods / TextWidth

Help: Report.TextWidth method

Docs / Office VBA Reference / Access / Object model / Report object / Properties / CurrentX

Help: Report.CurrentX property

Docs / Office VBA Reference / Access / Object model / Report object / Properties / CurrentY

Help: Report.CurrentY property

Docs / Office VBA Reference / Access / Object model / Report object / Properties / FontSize

Help: Report.FontSize property

Docs / Office VBA Reference / Access / Object model / Report object / Properties / ForeColor

Help: Report.ForeColor property

Goto Top  

Backstory

Someone wrote and asked me to make my popup calendar to pick dates to use Monday as the start day for the week since he's in France and that's the way they do it.

I'm fascinated by the power of drawing on reports, and so I dove into making calendars ... do you like it?

If you want to customize this in a way that isn't demonstrated, or need help understanding, contact me. I'm happy to help.

Special thanks to Duane Hookom, Dale Fye, Daniel Pineault, Arvin Meyer, and Adrian Bell.

Please donate to help with costs, thank you!

Share with others

here's the link to copy:

https://msaccessgurus.com/tool/CalendarMaker.htm

Share

Communicate, collaborate, and appreciate ... email me anytime at info@msAccessGurus.com. I enjoy hearing from Access users and developers.

Do you need help?

Do you have a project that could benefit from an expert developer helping you? Let's connect and build your application together. As needed, I'll pull in code and features from my vast libraries, cutting out lots of development time. Let's build whatever you're working on together! I look forward to hearing from you.

Email me anytime at training@msAccessGurus.com
~ crystal

Are you looking for one-on-one help?

Let's connect and team-develop while we build your application together.

Goto Top