Popup Calendar, works in Access 2007+ & lower too
Printed From: Roger's Access Library
Category: Other Download Libraries
Forum Name: Long, Crystal
Forum Description: Access Basics is designed for those of you with a thirst to understand the fundamentals of Access with programming in mind ... whether you realize it or not.
Printed Date: 24 Mar 2017 at 8:51pm
Topic: Popup Calendar, works in Access 2007+ & lower too
Posted By: Crystal Long
Subject: Popup Calendar, works in Access 2007+ & lower too
Date Posted: 27 Jun 2012 at 4:42pm
uploads/84/PopupCalendar_Crystal_120701_ACCDB_TXT_notCompiled_.zip" rel="nofollow - uploads/84/PopupCalendar_Crystal_120701_ACCDB_TXT_notCompiled_.zip
explodes into an Access 2007 database and a ReadMe text file.
thanks to Brian Keanie for testing the Access 2000 conversion with Access 2003 (added Jan 2015)
uploads/84/PopupCalendar_131019_Access2000.zip" rel="nofollow - uploads/84/PopupCalendar_131019_Access2000.zip
links to a related calendar report tool and a popup calendar that works with earlier versions of Access are at the bottom :)
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.
f_PopupCalendar_Test 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.
To use the popup calendar in another database, import:
... all the code it needs is behind the form
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 ~~~~~~~~~
Whenever you change code, references, or switch versions or operating environment, you should always compile and save before executing.
from the menu in a VBE (module) window: Debug, Compile
fix any errors on the yellow highlighted lines
keep compiling until nothing happens (this is good!) -- then Save
I usually assign this Double-Click [Event Procedure] to each date control:
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.
Switching to other dates is quick. There are built-in buttons for:
UNDO changes you have made in the calendar by clicking the RESET button
- 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
- and ANY specified number of days you wish ... positive or negative
if you click OK by mistake, just press ESCape when the form closes to undo changes to the control
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
The Calendar that is built in to Access works great -- as long as the date you want is close to today
... or maybe you would rather use THIS calendar ...
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.
Calendar Report in HTML format
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=599&title=calendar-report-in-html-format" rel="nofollow - http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=599&title=calendar-report-in-html-format
For Access 2003 and below, get my PickDate download from UtterAccess
Date Picker Popup (Access 2K) posted in 2004
http://www.utteraccess.com/forum/Date-Picker-Popup-t377434.html" rel="nofollow - http://www.utteraccess.com/forum/Date-Picker-Popup-t377434.html
(you have to be signed in to download -- UA is a great forum to be
part of so if you haven't joined yet, pick a username you want your
friends to call you and start posting :)
Feedback is appreciated, thank you
remote programming and training
Access Basics by Crystal
http://www.AccessMVP.com/strive4peace" rel="nofollow - http://www.AccessMVP.com/strive4peace
Free 100-page book that covers essentials in Access
Remote Training and Programming
http://www.MsAccessGurus.com" rel="nofollow - http://www.MsAccessGurus.com
http://www.YouTube.com/LearnAccessByCrystal" rel="nofollow - http://www.YouTube.com/LearnAccessByCrystal
(: have an awesome day :)
Remote Training & Programming
Let's Connect and Build Together
~have an awesome day ~