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.
YouTube: CalendarMaker and Document SQL at Access DevCon 2020 (15:03)
YouTube: RowSourceType Callback Function in Microsoft Access (12:33)
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.
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.
The CalendarMaker has great flexibility, which the menu form shows (but you don't need the form to use the CalendarMaker). The menu just makes it easier to specify what you want. Click the yellow CalendarMaker "Open Calendar" button, or use the Alt-C shortcut key, to instantly make a calendar for any chosen month. There's a lot more you can do though!
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 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.
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 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.
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.
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:
... or with first day of the week set to Monday for our friends across the ocean in the United Kindom
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).
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.
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.
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.
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:
First day of the week is Sunday
First day of the week is Monday
First day of the week is Sunday, like Americans ... but the holidays are a little different ...
First day of the week is lundi
First day of the week is domingo
First day of the week is mandag
CalendarMaker requiredTo 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 formIf 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 |
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 featurenot 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 Sportsif 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 |
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)
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.
If you're using Access 2007, get this version. Sample data for dates in 2020 or 2021
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
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
Report Draw Reference for VBA syntax and help for drawing on Access reports.
Help: WeekdayName function
Help: Report.Line method
Help: Report.Print method
Help: Report.TextHeight method
Help: Report.TextWidth method
Help: Report.CurrentX property
Help: Report.CurrentY property
Help: Report.FontSize property
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!
Communicate, collaborate, and appreciate ...
email me anytime at info@msAccessGurus
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
~ crystal
Let's connect and team-develop while we build your application together.