Admin Note This thread has been closed as it has gotten just too big.
If you have any questions about the application discussed in this thread please start a new thread in MS Access by clicking on the Start a Discussion button and link to the this thread in your question. Original Question
Just wondering...Am I the only one in the access universe that would like an Outlook like calendar option? Is there such a thing as a calendar that can be used for data entry? You know...double click the day and "POP" up comes the event screen to enter data into. I have spent countless hours searching for such a phantom. Any thoughts or sites with a template/example/download? Admin Edit
For ease of usage I will include a link here to the post in this thread with the latest version of the solution database.
Currently this is at Post #298.
Alternatively, if the attachment is all you require, then you'll find it here ( Calendar.zip).
A wide angled version (for wider screen real-estate) has also been posted now at Post #327. The attachment there is Wide Calendar with Switchboard.zip.
Jan 19 '08
340 108285
I must say that it does make the Calendar uniform and symmetrical, thank you.
You are quite welcome. I must state again that I am not the original creator of the Calendar Database. The original Author is a friend and ex co-worker who created this basically as a Platoon Scheduler and simple Events Posting utility. With his explicit permission, I've simply adapted it many times over the years for specific purposes and distributed it as freeware to the GP.
NeoPa 32,556
Expert Mod 16PB
Well then - thanks certainly go to your generous ex- co-worker.
We still appreciate the time, effort and understanding you put in on behalf of numerous members to provide this and make certain changes so that they can all use it easily. That is no mean offering my friend, and I'm pretty sure most of those you've helped very much appreciate your part in all this.
Hello again, edsuk: - BTW, for my own curiosity, did you have to swap Lines 21 and 26 as I indicated to in Post #228?
- There is a Logic Bug that you should be aware of and correct. I discovered the Bug awhile ago, and I actually corrected it minutes ago (I know, I know!). Should you ever set a Reference to the ADO Object Library as well as DAO, and place it at a higher Priority Level within the References, the code will crash for obvious reasons (DAO References for db and rstEvents were not Explicitly Declared.
- The following Line of Variable Declarations in the PopulateCalendar() Routine should be changed. Original Declarations are:
- Dim astrCalendarBlocks(1 To 42) As String, db As Database, rstEvents As Recordset
but they should be: - Dim astrCalendarBlocks(1 To 42) As String, db As DAO.Database, rstEvents As DAO.Recordset
- Because of the Logic used implementing this Database, the constant Deleting and Appending of Records to an Intermediate Table, frequent Compacting of the Database should be performed on a regular basis.
- When I get a chance, I will Post the Calendar Database with the Logic Bug corrected, edsuk's significant Update, and some visual enhancements to frmCalendar. When this happens, prior Attachments will be removed.
hi ADezii
1) Yes I did have to modify this line to the UK date format. Thanks for the heads up on this - would have taken me ages to figure out otherwise.
2) I do have a reference to both DAO and ADO in my Db with DAO being higher, good to know that you spotted it for for future reference.
3) OK
4) Yes, always good to perform this action periodically.
5) Significant update - I think not LOL
Again thank you and thanks to your friend/ex co-worker..
@NeoPa
Thanks for the kind words, NeoPa.
@edsuk
Yes I did have to modify this line to the UK date format. Thanks for the heads up on this - would have taken me ages to figure out otherwise.
Our own beloved msquared spotted this Bug awhile ago when I was at my wits end trying to determine where the problem was. Simple no peripheral vision, I guess. Thanks again Mary.
Here is the latest Calendar Demo, with all Revisions and Enhancements, for a Date Range.
Your calendar form looks great and is what I have been searching for. However, I don't know how to impement it in my database. Do I need to import all the queries in addition to the mods and form? What lines need to be changed to work with my table?
Table:
Training_Events
Fields:
ID
Title
Start Date
End Date
Start Time
End Time
Location
Description
Trainer
Vendor
Attachements
I am building a database to keep track of maditory State and Federal training for employees. This form would be a great way to view my scheduled training events and I wouldn't have to do double entry on my Groupwise calendar.
Any help is greatly appreciated. I am not very good at coding.
Thanks
- If you can, Upload a Database consisting of only the Table Training_Events and approximately 12 Records.
- Let me know what Field(s) you wish to display in the Calendar for any given day.
- From this I'll construct a simple Demo from which you can get started.
- With limited coding experience, this would probably be your only option.
I would like the event title and the start time to show in the calendar.
Thanks for your help!!!!!
Sorry, but I am not runningt Access 2007. Can you convert this DB to Access 2003 Format? If you cannot, I'll simply duplicate the Table Structure, but this would simply prolong the process.
Here it is. I had to change the attachment feild to text type in order to get it to convert, but I don't think that should effect anything.
Thanks.
See how this (Attachment) works out for you:
ADezii,
Wow Great Form!! Thanks for help on this! I think I have it working, I had to delete the attachemnt field from both tables in my 2007 database. the calendar form would not work or populate with the attachment field for some reason when the property was set to the new 2007 attachment property. I made sure both fields were set to the attachment property, but that didn't make a difference. Once I deleted that field, the form opened up fine. I also had found that when I tried to create a macro button to open then form in dialog mode from my main Training Event form, that the calender would open blank and I had to switch to the month from the drop down list or click the Sync Up botton. It has something to do with the dialog mode. In normal mode it opens to the correct month but I lose all my top row of buttons. I have solved this for now by copying the code from the Sync Up button and copying it to the On Load event. Now the form opens in Dialog mode and populates the calendar with the current month. I hope this is the right fix for opening the form.
Thanks for your help
You are quite welcome. There is a Bug in the code relating to the display of the Start Date within the Events List Box at the bottom of the Calendar Form. Should an Event span multiple days, the Start Date in the List Box will reflect the actual Date selected in the Calendar itself, and not the True Start Date. I'll try to correct it this evening, then Upload the amended Database as an Attachment. I would hold off incorporating the Calendar into your DB until I get this fixed. It involves changes in a couple of Procedures, modifying at least 1 Property of the Events List Box, and adding an additional Field to the TEMP Table. Stay tuned... P.S. - Because of the logic used in this Database, namely the constant Deletion and Appending of Records to an Intermediate Table, I would periodically Compact the DB.
ADezii
I looked at the multiple date span and how it shows is fine with me since the end date stays the same. It doesn't cause me any confusion since the dates all show in the calendar. So you don't need to worry about fixing that for me.
I do have the calendar in my database and it is working fine and I really like it.
I do have one question that I am not sure if it can be done. I set the double click property to:
DoCmd.OpenForm "Training Events Details", acNormal, , , acFormAdd, acDialog
Is there way to insert the date of the day that is double clicked into the date field as the form is opened?
Yes there is. I am heading to work right now, but I will try to get to it this evening and Post just the additional code (Single Line) here.
It's not exactly intuitive, but the actual Date Value of the Calendar Block (Text Box) Dbl-Clicked on can be retrieved via the Blocks’ Tag Property then passed as an Argument to the OpenForm() Method. In the Current() Event of Training Events Details, a Date Field can then be populated with this Value. - In the Dbl-Click() Event of 'ALL' 42 Text Boxes, Copy-N-Paste the following Line of Code substituting each Block's Name. I'll use the 4th Text Box for an example:
- Private Sub txtDayBlock04_DblClick(Cancel As Integer)
-
DoCmd.OpenForm "Training Events Details", acNormal, , , acFormAdd, acDialog, CDate(Me![txtDayBlock04].Tag)
-
End Sub
- In the Current() Event of the Training Events Details Form Copy-N-Paste the following Line of Code:
- Private Sub Form_Current()
-
If Me.NewRecord Then
-
Me![<Date Field Name>] = Me.OpenArgs
-
End If
-
End Sub
- Any further questions, feel free to ask.
That worked! The only thing I need to do is figure out a good way to prevent numerous records with just a start date from building up if someone double clicks on a few different dates on the calendar and decided not to enter an event. I fixed that problem for now by running a deleted query on close that will delete all records without a title. I'm sure there is a better way but that was the only way I could figure to keep numerous unwanted records from being entered.
If I new I was the only one who was going to use this database, I wouldn't worry about it and just delete the few times I might accidentally insert an erroneous record. However, I am collaborating with the State which is interested in my project and has asked to share it with others in our State. For this reason I am trying to make it user friendly for someone who may have very little Access experience. I am just a few steps above a novice and I am very thankful for forums like this where one can find so much help!
The only thing I need to do is figure out a good way to prevent numerous records with just a start date from building up if someone double clicks on a few different dates on the calendar and decided not to enter an event.
- Make one or more Fields Required - the User will not be able to Save the Record without enter Data into this/these Fields.
- Validation Code in the BeforeUpdate() Event of the Form, seating the Cancel Argument to True when necessary.
@ADezii
What is the code that would go in the BeforeUpdate() Event?
My Title field was origninally required but I found that it created a error message on close that made it very difficult to close the form. The error just kept looping back. Will step two prevent all the warning messages?
I turn the warnings off then back on with the delete query so that no messeges show.
Thanks
@ADezii
I found the following code on the web that seems to work on close. It gives the user the choice to go back to the form or cancel the record. I went back and set my Title field to required and this code worked fine for closing the form without saving the record. - If IsNull(Me![Title]) Then
-
If MsgBox("'Title' must contain a value." & Chr(13) & Chr(10) & _
-
"Press 'OK' to return and enter a value." & Chr(13) & Chr(10) & _
-
"Press 'Cancel' to abort the record.", _
-
vbOKCancel, "A Required field is Null") = vbCancel Then
-
DoCmd.Close
-
' For Access 2.0 remove the previous line and replace with:
-
' DoCmd Close
-
Else
-
Me![Title].SetFocus
-
End If
-
Else
-
DoCmd.Close
-
End If
ADezii
Thanks for all your help, I think I have everything going well with the calendar. I have just one question left, (hopefully my last dumb question). Is there a way to generate the Sync Up comand for the calendar when I close the Training Events Detail form?
After I double click a calendar date to add an event, enter the info and then close the form, I notice the calendar does not show the new date unless I click the Sync Up button. It's not a big deal to hit the sync button but I thought it would be nice it I could get the calendar to sync up when the Events Detail Form closes. I did try to put the Sync Up code on the Got_Focus and Current Events of the Calendar form, but neither of those worked.
Thanks for all your help!!!!!
In the Close() Event of the Training Details Form: - Private Sub Form_Close()
-
'Explicitly Set Focus to the Calendar Form
-
Forms![frmCalendar].SetFocus
-
-
'Activate the Shortcut Key for the Sync Command Button
-
SendKeys "%S", True
-
End Sub
@ADezii
Perfect! Perfect! You made my day! Thanks so much for all your help!
Youo are quite welcome. enjoy the Application.
ADezii
Is it possible to make a double click on a record that shows in the bottom LstEvent box to open my Training Events Detail to open to the record shown? I tried a typical macro to open the record by the ID but I get a function error.
I thought it would be nice to open a record that way if there was a date or other change that needed to be made.
Thanks
In the lstEvents_DblClick() Event: - Private Sub lstEvents_DblClick(Cancel As Integer)
-
DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit
-
End Sub
I'll add this on Monday when I get back to work! Thanks for the prompt reply. Your Calendar is really cool!!
@ADezii
ADezii,
How do I get the form to open in dialog mode? The form is opening in the tab behind the Calendar where I can't get to it without closing the Calendar. It is, however, finding the right record.
When I tried: - Cmd.OpenForm "Training Events Details", acNormal, , , , acDialog, "[ID] = " & Me![lstEvents].Column(0), acFormEdit
I recieved the error messae that says , "Wrong number of arugments or Invalid property Assignment. If I take the ", acFormEdit" off the end of the code the form will open in dialog mode but goes the the first record in the table instead of the record I clicked on. Your help is greatly appreciated.
Thanks
ADezii,
Never mind, I figured it out. I was putting AcDialog in the wrong place. This code worked: - DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
Thanks for such a cool calendar!!
ADezii,
I found a small bug in the Double click event for the lstEvents box. If only one record shows in the box and I accidentally click on the open space below the record, but within the box, I get a run time error that says there is a Syntax error or missing operator in the query expression ID =
If I Choose End instead of Debug on the error message, the calendar stops functioning and I have to exit. Is there a way to fix this?
Adezii,
I've kinda fixed the bug for now by adding an On Error GoTo statement so now a user will get a message to double click on the record instead of the runtime error. - Private Sub lstEvents_DblClick(Cancel As Integer)
-
On Error GoTo Error_lstEvents_dblclick
-
DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
-
-
Exit_lstEvents_dblclick:
-
Exit Sub
-
-
Error_lstEvents_dblclick:
-
MsgBox "Please double click on the record.", vbInformation + vbOKOnly, "No Record Selected"
-
-
Resume Exit_lstEvents_dblclick
-
-
End Sub
Is this the best way to handle this? It works for now.
Thanks
- Private Sub lstEvents_DblClick(Cancel As Integer)
-
If Not IsNull(Me![lstEvents].Column(0)) Then
-
DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
-
Else
-
MsgBox "You must Dbl-Click on a specific Record and not on an Emply Space " & _
-
"in the List Box", vbExclamation, "No Record Selected"
-
End If
-
End Sub
NeoPa 32,556
Expert Mod 16PB
So you shouldn't click on emply spaces then ADezii?
@NeoPa
That would appear to be the Lesson Learned for the day, NeoPa. (LOL).
NeoPa 32,556
Expert Mod 16PB
What about empty ones then?
ADezii
My Training Events Details form can be opened from my Main Events form or the Calendar. I've added a list box on the form that show all the records that occure on the date selected in the [Start Date] field. The data for the list box is drawn from the temp table. I chose the temp table because I like how your temp table splits up a record that contains start and end dates that spands several days. The list box is meant to act like a calendar day view. The only small draw is when the form is opened from my main form instead of the calendar and records are entered. These new records will not show in the listbox because they don't exist in the temp table. Is there away to repopulate the temp table on closing my Details form while the Calendar form is not open? I tried an append query but I didn't like the way it works because I found it I could end up with duplicate records. Especially if the form was open to a specific record to change a detail. The duplicates, of course, went away once I opened the calendar.
The tempory duplicates don't bother me, but I don't want to confuse any other person who may end up using this database.
Thanks
Append the records as normal, then Define the Row Source of the List Box as an SQL Statement using the DINSTINCT Statement since this will eliminate Duplicates.
Hi guys,
First of all I would like to say thank you for sharing this great calendar form. but i would like to point out that there seems to be an error when the calendar is populated with the dates. I have it up and running and the dates are set off. For example March 17, 2010 is set to tuesday instead of wednesday. April 1st, 2010 starts on monday instead of thursday. Is this a flaw or am I doing something wrong. I have downloaded multiple versions and they all seem to have the same issue.
Thank you
xraive
Kindly Upload the Calendar that you are referring to, and I'll take a close look at it. This problem definitely should not be happening.
P.S. - What Country are you from?
Thanks for looking into this. I have posted a sample DB that will show the problem. But this did also happed with the sample db on post# 246.
By the way, I am from Canada.
Thank you,
Before I attempt anything, Comment Code Line #21, and Uncomment Code Line #26 in the PopulateCalendar() Sub-Routine, exactly as depicted, then get back to me. - Private Sub PopulateCalendar()
-
On Error GoTo Err_PopulateCalendar
-
Dim strFirstOfMonth As String, bytFirstWeekdayOfMonth As Byte, bytBlockCounter As Byte
-
Dim bytBlockDayOfMonth As Byte, lngBlockDate As Long, ctlDayBlock As control
-
Dim bytDaysInMonth As Byte, bytEventDayOfMonth As Byte, lngFirstOfMonth As Long
-
Dim lngLastOfMonth As Long, lngFirstOfNextMonth As Long, lngLastOfPreviousMonth As Long
-
Dim lngEventDate As Long, bytBlankBlocksBefore As Byte, bytBlankBlocksAfter As Byte
-
Dim astrCalendarBlocks(1 To 42) As String, db As DAO.Database, rstEvents As DAO.Recordset
-
Dim strSelectEvents As String, strEvent As String, strPlatoons As String
-
Dim lngSystemDate As Long 'CFB added 1-25-08
-
Dim ctlSystemDateBlock As control, blnSystemDateIsShown As Boolean 'CFB added 1-25-08
-
Dim strSQL As String 'Added 4/16/2008
-
Dim blnRetVal, intNumOfRecs As Integer
-
-
lngSystemDate = Date 'CFB added 1-25-08
-
intMonth = objCurrentDate.Month
-
intYear = objCurrentDate.Year
-
lstEvents.Visible = False
-
lblEventsOnDate.Visible = False
-
lblMonth.Caption = MonthAndYear(intMonth, intYear)
-
'strFirstOfMonth = Str(intMonth) & "/1/" & Str(intYear)
-
-
'*************************************************************************
-
'ADezii
-
'NOTE: Will work in the UK (United Kingdom) and other European Nations
-
strFirstOfMonth = "1/" & Str(intMonth) & Str(intYear)
-
'*************************************************************************
-
-
bytFirstWeekdayOfMonth = Weekday(strFirstOfMonth)
-
lngFirstOfMonth = DateSerial(intYear, intMonth, 1)
-
lngFirstOfNextMonth = DateSerial(intYear, intMonth + 1, 1)
-
lngLastOfMonth = lngFirstOfNextMonth - 1
-
lngLastOfPreviousMonth = lngFirstOfMonth - 1
-
bytDaysInMonth = lngFirstOfNextMonth - lngFirstOfMonth
-
bytBlankBlocksBefore = bytFirstWeekdayOfMonth - 1
-
bytBlankBlocksAfter = 42 - (bytBlankBlocksBefore + bytDaysInMonth)
-
'...Balance of code intentionally omitted
Thank you it works like a charm. Can you explain that line.
Always appreciated ADezii
It all has to do with how Dates are Formatted/Displayed in a particular Locale. strFirstOfMonth is a variable that will hold the First Day of the Month as a String.
will work in the UK (United Kingdom), certain European Nations, and obviously Canada, while
will work in the United States. P.S. - It took a while to figure this out, and it was our own Mary that provided the answer to this dilemma.
Here is the latest Release of the Access Calendar with Sample Data. It is, however still going through a Revision Stage. Should you have any questions, please feel free to ask.
Thank you! I will work with this tonight and see what I can do about modifying it to our needs and let you know!!!
DC
NeoPa 32,556
Expert Mod 16PB
I assume that was for a new version ADezii. Clearly there would be no point in reposting it if it's the same version as the last one yes?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: nh_capricorn |
last post by:
Hi,
I am fairly new to .NET (coming from a Java background) and I am trying to
port an application that I originally wrote in Java, to .NET / C#. My problem
is that I cannot find a C# analog for...
|
by: Shyguy |
last post by:
Is it possible to create a calendar that shows previous input data and
also allows for input of new data?
|
by: Matthew |
last post by:
I currently have a form in MS Access that has certain combo boxes
which specify criteria in order to run a query based on that criteria.
I want to add to this, a calendar from which a user will be...
|
by: Ben |
last post by:
I have a javascript code in the ASP.NET page.
I want to access Calendar control that is inside ASP page and is "run
at server".
I try to use following code but it doesn't work.
<script...
|
by: afr0ninja |
last post by:
Hello all, and thank you in advance for your assistance.
I'm pretty new to access and I'm trying to teach myself some VBA by
using various bits of code I find here and there mixed with my own....
|
by: Robert Waggoner |
last post by:
My Access 97 database is on a public network so it can be accessed by a
dozen users. On my computer the Active X calendar shows the GridFont as 8
pt. On some user's computers the gridfont size is...
|
by: rcollins |
last post by:
I have a calendar on my form that inputs the date selected. Right now, the date isn't updated until I click on the date box after selecting the date. Is there a way for me to update as I click on the...
|
by: apartain |
last post by:
Has anyone ever created a shared calendar within Access? It would be similar to MS Outlook, but clearly not as in-depth. I would need to use it for employees to enter their availability so managers...
|
by: Dalia Allencher |
last post by:
I have to plan the work schedule.
For example: The process has several steps.
Steps Step 1 Step 2 Step 3
Due dates 2/5/2011 2/10/2011 2/15/2011
I want to create a calendar...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |