|Please consider donating $1 per sample downloaded, (find out why here)|
Popup Calendar, works in Access 2007+ & lower too
Joined: 21 May 2012
Posted: 27 Jun 2012 at 4:42pm
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)
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:
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:
Calendar Report in HTML format
For Access 2003 and below, get my PickDate download from UtterAccess
Date Picker Popup (Access 2K) posted in 2004
(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
Free 100-page book that covers essentials in Access
Remote Training and Programming
(: have an awesome day :)
Remote Training & Programming
Let's Connect and Build Together
~have an awesome day ~
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum