UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> Popup Calendar    
Popup Calendar


Popup Calendar that works with Access 2007 and above!

No ActiveX controls. Everything is built using basic Access controls. The design and code are open.

 Popup Calendar for Microsoft Access


There are 2 forms in this download.


loads automatically when this database is opened. It is not needed for the calendar -- it is only in the database as an example of how to use the popup calendar.


... all the code the popup calendar needs is behind this form. To use the popup calendar in another database, this form is all you need to import.

Compile code before running

COMPILE THE CODE BEFORE YOU RUN IT! The database is not compiled.

the first time you open this:

  1. CLOSE the test form that automatically opens
  2. press ALT-F11 to go to the VBE (Visial Basic Editor)
  3. from the menu, choose --> Debug, Compile...

compile steps

Whenever you change code, references, or switch versions or operating environment, you should always compile and save before executing.

  • press Alt-F11 to go to the VBE (Visual Basic Editor)
  • from the menu, choose Debug, Compile
  • fix any errors on the yellow highlighted lines
  • keep compiling until nothing happens (this is good!) -- then Save

Launching the Popup Calendar

I usually assign this Double-Click [Event Procedure] to each date control:

  DoCmd.OpenForm "f_PopupCalendar"

what happens

the popup calendar reads the ActiveControl to get date and, optionally, time if it is filled out. When OK is clicked on the popup calendar, the control you came from is updated with what was chosen.

Change Date Quickly

Switching to other dates is quick. There are built-in buttons for:

  • back one day
  • forward one day
  • back one week
  • forward one week
  • back one month
  • forward one month
  • back one quarter
  • forward one quarter
  • back 6 months
  • forward 6 months
  • back one year
  • forward one year
  • back 10 years
  • forward 10 years
  • Today
  • and ANY specified number of days you wish ... positive or negative

UNDO changes you have made in the calendar by clicking the RESET button if you click OK by mistake, just press ESCape when the form closes to undo changes to the control

Code Notes

You do not have to test for a weekend, all the days can be bold. There is a parameter in the procedure that colors the controls to determine if weekends will be treated differently.

If you are using the popup calendar to collect information for something else, you can send an OpenArg with a date and the ActiveControl stuff will be skipped. This is not tested ... the logic is in there and commented.

This has tons of uses and other applications with slight modification. I have a version of this that checks to see if the calendar is being used as a subform and if so, it sets Visible and Left for buttons with something particular in the Tag, and changes the form width.

I have included a procedure to Update External Forms, and it is called every time the calendar is set. This makes it easy for you to hook the calendar in to your application.

The numbers are in the upper left of each day to give room for Labels, Textboxes, or something else to show on each day. If you wish the days to be centered on each day, edit the Set_DefaultFormat sub. You can change the colors that Today and the Pick day use by editing Mark_TodayAndDate

Hey did you realize that the colored buttons are command buttons! This is a built-in feature for Access 2007 and above  :)

Choosing a Date using the Access Built-In Calendar

The Calendar that is built in to Access works great -- as long as the date you want is close to today

 Floating Calendar built into Access

... or maybe you would rather use THIS calendar ...

Popup Calendar -- Today is Red, Pick is blue  Popup Calendar showing Today is Red and Pick date is blue

All the code is behind the form. You can easily add additional buttons for increments like:

  • 25 years
  • 30 days
  • 45 days
  • two quarters
  • ... whatever you use on a regular basis.

Optional Time Controls

as an option, you can also set time

Popup Calendar Time Controls


Download Access 2007 database with the Popup Calendar form and a test form


Related Downloads

create a calendar as a web page from any table or query! Easy to save and email!

HTML Calendar Report


Date Picker Popup (Access 2000 format)

posted in 2004 http://www.utteraccess.com/forum/Date-Picker-Popup-t377434.html

Edit Discussion
Custom Search

Thank you for your support!
This page has been accessed 23,937 times.  This page was last modified 02:10, 25 August 2012 by Mark Davis. Contributions by Jack Leach and Strive4peace  Disclaimers