I am using Access 2013 with Windows 7.
I am modifying this calendar:
https://bytes.com/topic/access/answers/761255-ms-access-calendar
I am getting a "Too few parameters - Expected 5" error message.
Are any other users of this calendar available to help with some modifications?
I am tracking Goals by date, not Events.
It appears that there hasn't been any activity with this app in a few years. I am hoping that ADezii is still involved with it.
Sidebar: I have spent countless hours looking for a form-based calendar that would, among other criteria, not be dependent on mscal.ocx or ActiveX controls. This calendar is fantastic!
Thank you,
Steve
- Rather than work within the context of your Database, I found it easier to create a New Database and Import the key Components into it, namely: the Calendar Table and DailyGoals Form. It now becomes a simple matter to integrate this new functionality into your Database by simply Importing frmCalendar and the Code Modules into it.
- When you Open the Demo you will see frmCalendar displayed along with your requested key Fields for each Day Block.
- Dbl-Clicking on a Day Block/Date will open DailyGoals with Data for that specific Date.
- Make any changes in DailyGoals then click the Close Button in the lower left corner.
- To see any changes that you made on the Calendar, click on the Sync Button in the lower left corner.
- If you are not interested in seeing these changes immediately, you can move to any other Month or Year and return to the modified Date. The Calendar will now be in sync in the Calendar Table.
- The ListBox functionality on the bottom of frmCalendar has been disabled since I saw no need for it in this current scenario.
- This is the essence of the Access Calendar. Download the Attachment and good luck with your Project.
P.S. - If you would like to have frmCalendar reflect any changes made on DailyGoals immediately you can Call the PopulateCalendar() Routine within the DblClick() Event of each Day Block. This will work since DailyGoals will be opened in Dialog Mode and the line of Code after the OpenForm() Method will not execute until after the Form is closed. Sorry if my explanation is confusing, but here is an example for Day Block #7: -
Private Sub txtDayBlock07_DblClick(Cancel As Integer)
-
DoCmd.OpenForm "DailyGoals", acNormal, , "[DateTime] = #" & CDate(Me![txtDayBlock07].Tag) & "#", acFormEdit, acDialog
-
PopulateCalendar
-
End Sub
20 1515
This screenshot is of a calendar I wrote years ago. Any help?
Phil
Regret my Calendar is completely different. It consists of 42 continuous subfoms which (as the picture shows) allows different colours to represent different kinds of event (e.g. Blue - Social, green - work, brown - Club Committee meetings). The main problem is that it takes about 2 seconds to load a month as there are a lot of subforms to fill.
Phil
Can you Upload your Database stripped of any sensitive Data along with a detailed explanation of exactly what is not working?
Hi ADezii,
Thank you for your reply.
Absolutely. I very much appreciate your help.
I will be able to strip the database later this evening. I'm in Oregon (PDT). I will upload it as soon as it is ready, along with a detailed explanation.
Thanks again!
Steve
Hi ADezii,
I have stripped the db.
The original calendar displays a datasheet under the calendar. Instead of displaying a datasheet, I want to doubleclick on a date and open a form (DailyGoals). I also want to display the data, for each of the following fields, within each respective date (DayBlock) on the Calendar:
Calendar.NPGoal
Calendar.PVGoal
Calendar.ROFArrived
Calendar.CPRArrived
Calendar.REVGoal
My Calendar table does not have any Start Time or End Time related fields.
I have tried to duplicate the changes that RockKandee made when you helped them, with limited success.
Currently, I am getting the following error, when I launch the Calendar:
Item not found in this collection.
I could use some help with the SELECT statements, given the fields in my Calendar table.
Thank you, once again,
Steve
I am extremely busy at work right now, but as soon as I get a chance, I'll be happy to look at the Database.
Hi ADezii,
I completely understand. I appreciate any help you can lend, very much.
I have made progress and am attaching the latest version.
Everything seems to be working fine. The subform populates correctly.
The one thing that I still haven't been able to figure out is populating each date with:
CalendarQ.NPGoal
CalendarQ.PVGoal
CalendarQ.ROFArrived
CalendarQ.CPRArrived
CalendarQ.REVGoal
I believe it has to do with the fact that I do not have a Start Time, End Time or Title.
Once I am able to display the data, I want to be able to double click the date and launch the DailyGoals form, for that respective date.
Once again, I appreciate any coaching you can provide and am very patient. :-)
Take care,
Steve
The one thing that I still haven't been able to figure out is populating each date...
Here is a partial Code Segment that should at least point you in the right direction: -
'CODE INTENTIONALLY OMITTED
-
Set db = CurrentDb
-
-
strSQL = "SELECT Calendar.CalendarID, Calendar.DateTime, Calendar.NPGoal, Calendar.PVGoal, Calendar.ROFArrived, " & _
-
"Calendar.CPRArrived, Calendar.REVGoal FROM Calendar WHERE Calendar.DateTime BETWEEN %F And %L ORDER BY " & _
-
"Calendar.CalendarID"
-
strSQL = Replace(strSQL, "%F", lngFirstOfMonth)
-
strSQL = Replace(strSQL, "%L", lngLastOfMonth)
-
-
Set rstEvents = db.OpenRecordset(strSQL) 'Added 4/16/2008
-
-
With rstEvents
-
Do While Not .EOF
-
'CFB added 2-18-10
-
lngFirstDateInRange = ![DateTime] '<Substitute for [Start Date], if Date Range>
-
If lngFirstDateInRange < lngFirstOfMonth Then
-
lngFirstDateInRange = lngFirstOfMonth
-
End If
-
lngLastDateInRange = ![DateTime] '<Substitute for [End Date], if Date Range>
-
If lngLastDateInRange > lngLastOfMonth Then
-
lngLastDateInRange = lngLastOfMonth
-
End If
-
-
For lngEachDateInRange = lngFirstDateInRange To lngLastDateInRange
-
bytEventDayOfMonth = (lngEachDateInRange - lngLastOfPreviousMonth)
-
bytBlockCounter = bytEventDayOfMonth + bytBlankBlocksBefore
-
If astrCalendarBlocks(bytBlockCounter) = "" Then 'no existing Text in Array
-
astrCalendarBlocks(bytBlockCounter) = "NPGoal: " & rstEvents![NPGoal] & vbCrLf & "PVGoal: " & rstEvents![PVGoal] & _
-
vbCrLf & "ROFArrived: " & rstEvents![ROFArrived] & vbCrLf & "CPRArrived: " & _
-
rstEvents![CPRArrived] & vbCrLf & "REVGoal: " & rstEvents![REVGoal]
-
Else
-
'CODE INTENTIONALLY OMITTED
-
Thank you, ADezii.
Currently, the code looks like this: -
Set db = CurrentDb
-
-
'CFB added 2-18-10
-
'<Substitute your own SQL Statement here>
-
strSQL = "SELECT Calendar.[CalendarID], Calendar.[DateTime], Calendar.[NPGoal], Calendar.[PVGoal], Calendar.[ROFArrived], " & _
-
"Calendar.[CPRArrived], Calendar.[REVGoal] FROM Calendar WHERE Calendar.DateTime BETWEEN %F And %L ORDER BY " & _
-
"Calendar.[CalendarID]"
-
strSQL = Replace(strSQL, "%F", lngFirstOfMonth)
-
strSQL = Replace(strSQL, "%L", lngLastOfMonth)
-
-
Set rstEvents = db.OpenRecordset(strSQL) 'Added 4/16/2008
-
-
-
With rstEvents
-
Do While Not .EOF
-
'CFB added 2-18-10
-
lngFirstDateInRange = ![DateTime] '<Substitute for [Start Date], if Date Range>
-
If lngFirstDateInRange < lngFirstOfMonth Then
-
lngFirstDateInRange = lngFirstOfMonth
-
End If
-
lngLastDateInRange = ![DateTime] '<Substitute for [End Date], if Date Range>
-
If lngLastDateInRange > lngLastOfMonth Then
-
lngLastDateInRange = lngLastOfMonth
-
End If
-
-
For lngEachDateInRange = lngFirstDateInRange To lngLastDateInRange
-
bytEventDayOfMonth = (lngEachDateInRange - lngLastOfPreviousMonth)
-
bytBlockCounter = bytEventDayOfMonth + bytBlankBlocksBefore
-
-
-
If astrCalendarBlocks(bytBlockCounter) = "" Then 'no existing Text in Array
-
astrCalendarBlocks(bytBlockCounter) = "NPGoal: " & rstEvents![NPGoal] & vbCrLf & "PVGoal: " & rstEvents![PVGoal] & _
-
vbCrLf & "ROFArrived: " & rstEvents![ROFArrived] & vbCrLf & "CPRArrived: " & _
-
rstEvents![CPRArrived] & vbCrLf & "REVGoal: " & rstEvents![REVGoal]
-
Else
-
strStartTime = Format$(rstEvents![Start Time], "Short Time") '<Substitute for [Start Time]>
-
'strStartTime = Format$(rstEvents![Start Time], "h:mm AM/PM") '<Substitute for [Start Time]>
-
End If
-
'<Substitute for [Title]>
-
If astrCalendarBlocks(bytBlockCounter) = "" Then
-
astrCalendarBlocks(bytBlockCounter) = "NPGoal: " & rstEvents![NPGoal] & vbCrLf & "PVGoal: " & rstEvents![PVGoal] & _
-
vbCrLf & "ROFArrived: " & rstEvents![ROFArrived] & vbCrLf & "CPRArrived: " & _
-
rstEvents![CPRArrived] & vbCrLf & "REVGoal: " & rstEvents![REVGoal]
-
' astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & vbNewLine & strStartTime
-
-
Else '<Substitute for [Title]>
-
' astrCalendarBlocks(bytBlockCounter) = astrCalendarBlocks(bytBlockCounter) & vbNewLine & _
-
' rstEvents![Title] & vbNewLine & strStartTime
-
End If
-
Next lngEachDateInRange
-
'End of CFB added 2-18-10
-
-
rstEvents.MoveNext
-
Loop
-
I am getting a "Compile error: Expected End With" message.
When you have a moment, could you please point to where this is bombing?
Also, in version 2, I was pulling from the CalendarQ query. You pulled directly from the Calendar table. Is there any reason for not pulling from the query?
Thank you for your continuing help, ADezii. :-)
Steve
I am getting a "Compile error: Expected End With" message.
You are only looking at a 'Code Segment' in PopulateCalendar() and not the Code in its entirety.
Also, in version 2, I was pulling from the CalendarQ query. You pulled directly from the Calendar table. Is there any reason for not pulling from the query?
None P.S. - Be patient and I'll have a working Demo for you in a day or two.
Thank you, ADezii!
In the meantime, I will continue to hammer away at it.
My coding skills are 20+ years old and I'm grappling with If, Then Else logic. At my age, being the student is a welcome state. :-)
If I am able to show progress, I will post Version 3.
My patience will meet, or exceed, your expertise and efforts to help with this. :-)
Thank you, once again, for helping with this.
Steve
- Rather than work within the context of your Database, I found it easier to create a New Database and Import the key Components into it, namely: the Calendar Table and DailyGoals Form. It now becomes a simple matter to integrate this new functionality into your Database by simply Importing frmCalendar and the Code Modules into it.
- When you Open the Demo you will see frmCalendar displayed along with your requested key Fields for each Day Block.
- Dbl-Clicking on a Day Block/Date will open DailyGoals with Data for that specific Date.
- Make any changes in DailyGoals then click the Close Button in the lower left corner.
- To see any changes that you made on the Calendar, click on the Sync Button in the lower left corner.
- If you are not interested in seeing these changes immediately, you can move to any other Month or Year and return to the modified Date. The Calendar will now be in sync in the Calendar Table.
- The ListBox functionality on the bottom of frmCalendar has been disabled since I saw no need for it in this current scenario.
- This is the essence of the Access Calendar. Download the Attachment and good luck with your Project.
P.S. - If you would like to have frmCalendar reflect any changes made on DailyGoals immediately you can Call the PopulateCalendar() Routine within the DblClick() Event of each Day Block. This will work since DailyGoals will be opened in Dialog Mode and the line of Code after the OpenForm() Method will not execute until after the Form is closed. Sorry if my explanation is confusing, but here is an example for Day Block #7: -
Private Sub txtDayBlock07_DblClick(Cancel As Integer)
-
DoCmd.OpenForm "DailyGoals", acNormal, , "[DateTime] = #" & CDate(Me![txtDayBlock07].Tag) & "#", acFormEdit, acDialog
-
PopulateCalendar
-
End Sub
Thank you AZDezii!
I am in a long meeting this morning. I look forward to working on this, immediately after my meeting.
You are the best.
Your reputation, at bytes.com, as generous and knowledgeable are highly deserved.
Thank you!!
Steve
Thank you Steve for the kind compliments. I'll check in again tomorrow to see how you made out - off to work right now.
Hi ADezii,
You nailed it! Your revised version resolved all of my issues, taught me much and added some things that I hadn't considered.
I can't thank you enough for your generosity and help.
As I went through the revised db and looked at how you did things that I had spent many hours struggling with, I felt like I was opening a Christmas present.
Thank you very much!
Take care,
Steve
You are quite welcome, good luck with your Project.
I had some spare time and I decided to increase the functionality of the Calendar by utilizing the List Box at the bottom of frmCalendar. It was there anyway just taking up space, so why not use it? (LOL).
Thank you very much, ADezii.
You continue to amaze!
I am attaching the latest version of the calendar. I was able to fit all 10 categories within each date.
With this in place, I'm not sure whether to add the datasheet back in. What do you think?
I am attaching a screen capture.
I couldn't have done it without your help.
Thank you, again.
Steve
I couldn't have done it without your help
I am sure that you could have, just would have taken a little longer. Project looks great - we are always here should you need us.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: eagleofjade |
last post by:
I am trying to help a friend who is learning VB.net in school. I have
done VB programming for a number of years using VB 6. He needs to open
a query in an Access database that has parameters so he...
|
by: Michael |
last post by:
Hi. I am working with classic ASP. I'd like to transfer al my hard coded sql
queries to access stored queries and use them with parameters. Actually, I
did not find any strong information how to do...
|
by: MyWaterloo |
last post by:
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...
|
by: ADezii |
last post by:
MS Access Calendar – OVERVIEW
Many times over the years, a similar type question has been asked of us here at Bytes, namely: How Can I Incorporate Calendar Like Functionality Solely Within The...
|
by: RockKandee |
last post by:
Hi,
I am getting an error message when trying to print.
I am using the MS access calendar found here:
http://bytes.com/topic/access/answers/761255-ms-access-calendar
I have Windows 8 and...
|
by: RockKandee |
last post by:
I am using the MS Access Calendar in Access 2013, Windows 8.
http://bytes.com/topic/access/answers/761255-ms-access-calendarhttp://
Currently I am using 4 calendar forms with the data source...
|
by: RockKandee |
last post by:
I am using the MS Calendar found on this site with Access 2013 on Windows 8.
http://bytes.com/topic/access/answers/761255-ms-access-calendar
I am working on adding a form that opens from a day...
|
by: RockKandee |
last post by:
Hi!
I am using Access 2013 with Windows 8
I am working with this calendar
http://http://bytes.com/topic/access/answers/761255-ms-access-calendar
I would like to know if there is a quick...
|
by: Seroki |
last post by:
So I found the great Calendar here on this forums and it seems to meet a good deal of my current project for my wife.
A bit of background my Wife insist on paying the bills well she is always...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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: 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,...
| |