Popup Calendar, works in Access 2007+ & lower too |
Post Reply |
Author | |
Crystal Long
Microsoft MVP Joined: 21 May 2012 Location: Colorado Status: Offline Points: 35 |
Post Options
Thanks(0)
Posted: 27 Jun 2012 at 4:42pm |
download:
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 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: f_PopupCalendar ... 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: DoCmd.OpenForm "f_PopupCalendar" 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:
Related tool: Calendar Report in HTML format by Crystal on RogersAccessLibrary http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=599&title=calendar-report-in-html-format Other versions: 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 (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 Warm Regards, Crystal Microsoft MVP remote programming and training Access Basics by Crystal http://www.AccessMVP.com/strive4peace Free 100-page book that covers essentials in Access Remote Training and Programming http://www.MsAccessGurus.com video tutorials: http://www.YouTube.com/LearnAccessByCrystal * (: have an awesome day :) * |
|
Warm Regards,
Crystal Microsoft MVP Remote Training & Programming Let's Connect and Build Together http://www.AccessMVP.com/strive4peace http://YouTube.com/LearnAccessByCrystal ~have an awesome day ~ |
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
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 |