473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MS Access Calendar

135 100+
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 108283
ADezii
8,834 Expert 8TB
kashif73, You are quite welcome.

I'm helping someone out with a Project similar to yours and which also includes some functionality similar to what you had requested. Check in from time to time, since I feel I can further enhance your Project with a little modification of my current work. I'll Attach what I have developed for you at that time.
Dec 10 '09 #151
ADezii
8,834 Expert 8TB
@kashif73
Download the Attachment and see if you can use the new functionality, if not, then nothing was lost. I intentionally did not Comment the New Code for the sake of brevity. Should you have any questions whatsoever, please do not hesitate to ask.
Dec 10 '09 #152
Thank you very much Azedii. It looks great.This is exactly what I wanted. You've solved my problem. A real big THANKS for this.
Dec 10 '09 #153
ADezii
8,834 Expert 8TB
@kashif73
You are quite welcome, kashif73. I'm glad that it all worked out for you. Remember to peeriodically Compact/Repair the Database because of the nature of it.
Dec 10 '09 #154
yiwen
2
Hello Adezii,
Could you please post a link for a generic functionnality of the calendar.
There is no attachement on post 59 and 60 like mentionned in some posts.

Thanx
Dec 29 '09 #155
ADezii
8,834 Expert 8TB
Are we talking about a Single Date (Date) or Date Range (Between Date1 And Date2)?
Dec 29 '09 #156
yiwen
2
Hi
I am looking for the version wich could be better for managing appointements for each day. (it should be one date).
Dec 29 '09 #157
ADezii
8,834 Expert 8TB
Try this for a Single-Date Demo:
Dec 29 '09 #158
mahogg
2
Hi, I'm looking for a calander to sit in an Acc 2007 database. I was reading through this thread with interest, but cannot actually find a link or download for ADezii's calander. I'd love to take a look and see if it would fit my needs, assuming of course, you can still share the project?
regards,
mike.
Jan 11 '10 #159
MMcCarthy
14,534 Expert Mod 8TB
mahogg

Can you see the attachment in ADezii's last post.

http://bytes.com/topic/access/answer...ar#post3535204
Jan 11 '10 #160
NeoPa
32,556 Expert Mod 16PB
Msquared is referring to post #189 of course. It may be that this particular one, doctored for the needs of the previous poster, is not what you're after. If so, then please indicate which version you're having trouble with and we can check to see what the problem may be.
Jan 11 '10 #161
ADezii
8,834 Expert 8TB
Hello Mike, if you clearly state exactly what your needs are, along with the relevant information and sample data, then I will be happy to retrofit the Calendar for a simple demo, and Attach it for you to view. It's up to you.
Jan 12 '10 #162
mahogg
2
Thanks for the prompt replies and your kind offer of help, Adezil.
I'm new to Access and have been learning on the hoof. I've adapted the Northwind sample in Acc2007, adding several tables, queries & forms of my own. I wanted to add a calendar to the 'Northwind Home' page, replacing the chart they use in the sample form. I'd like to be able to enter text representing events, tasks, reminders etc. and have either a daily, weekly or monthly view option. Your zip file in #189 looks like it might fit the bill. Would it be possible to link it to a separate tbls/qrys/subfrm's for Events, Meetings and Tasks? Excuse my rather shallow knowledge of databases so far, as I say, I'm learning on the go but I 'plateau' round about the level of amending pre written macro's . . .
I'm struggling to attach anything meaningful as there are so many underlying objects linked to the home page. Hopefully you can open the sample in Acc2007 and see what I'm referring to?
Thanks again guys.
Mike.
Jan 13 '10 #163
ADezii
8,834 Expert 8TB
Sorry Mike, not running Access 2007. The Calendar is an Unbound Access Form and as such cannot be Embedded or Linked To the Northwind Home Page. It can, however, be Opened in any manner from the Opening Form. It appears as though you are asking for a full blown Task Manager/Scheduler which the Calendar is not. It is simply used as a monthly, graphical display of limited data with full Navigation capabilities. Provide me with some simple data such as [Start Date], [End Date], [Event Name], [Originator], etc. and I'll see what I can do for you.
Jan 13 '10 #164
ADezii,

I must say I love the Calendar_SingleDate demo you posted. I have incorporated it into a database that I am building. I ran into a small issue in doing so. I am using an Access front end and a SQL 2005 backend. The code worked fine before upsizing the backend to SQL.

My current issue occurs when I click on a day in the calendar, the list box shows data for a date two days after the chosen date. For instance, if I click on January 3, 2010, the list box shows data for January 5, 2010. The list box consistently shows data for a date two days in the future regardless of the day chosen on the calendar. Do you have any idea why I am experiencing this issue?
Jan 13 '10 #165
ADezii
8,834 Expert 8TB
If you are using the Demo DB to base your case on, the actual Date Used (Criteria) to populate the List Box is [ReviewDate] as indicated in Lines 7 and 8, whereas the other Dates ([QIPStartDate], [QIPEndDate]), are simple for display purposes only as indicated in Lines 5 and 6.
Expand|Select|Wrap|Line Numbers
  1. Private Sub PopulateEventsList(ctlDayBlock As Control)
  2. On Error GoTo Err_PopulateEventsList
  3. Dim strSQL2 As String
  4.  
  5. strSQL2 = "SELECT tblReviews.[ClientName] As [Client Name], tblReviews.[QIPStartDate] As [QIP Start Date], " & _
  6.           "tblReviews.[QIPEndDate] As [QIP End Date]" & _
  7.            "FROM tblReviews WHERE tblReviews.[ReviewDate] = " & _
  8.            ctlDayBlock.Tag & " ORDER BY tblReviews.[ReviewDate];"
  9.  
  10. lstEvents.RowSource = strSQL2
  11.  
  12. lblEventsOnDate.Caption = Format(ctlDayBlock.Tag, "m-dd-yyyy")
  13. lstEvents.Visible = True
  14. lblEventsOnDate.Visible = True
  15.  
  16. Exit_PopulateEventsList:
  17.   Exit Sub
  18.  
  19. Err_PopulateEventsList:
  20.   MsgBox Err.Description, vbExclamation, "Error in PopulateEventsList()"
  21.   Resume Exit_PopulateEventsList
  22. End Sub
P.S. - Place the following Line off code anywhere within the PopulateEventsList() Procedure. It should accurately reflect the selected Day in the Calendar.
Expand|Select|Wrap|Line Numbers
  1. MsgBox CDate(ctlDayBlock.Tag)
Jan 13 '10 #166
The unbound textboxes that create the calendar display the data accurately. If I click on any one of the days of the month, the label next to the list box at the bottom of the form displays the chosen date; however, the list box does not list the data accurately. The list box displays data that is two days in the future. I have attached a screen shot to provide a better picture.



The code below is what I have listed to populate the list box:

Expand|Select|Wrap|Line Numbers
  1. Private Sub PopulateEventsList(ctlDayBlock As Control)
  2. On Error GoTo Err_PopulateEventsList
  3. Dim strSQL2 As String
  4.  
  5. strSQL2 = "SELECT dbo_tblEvents.[EventID] As [Event ID], dbo_tblEvents.[EventName] As [Event Name], dbo_tblEvents.[Location] As [Meeting Room], " & _
  6.           "dbo_tblEvents.[StartDate] As [Start Date], dbo_tblEvents.[EndDate] As [End Date]" & _
  7.            "FROM dbo_tblEvents WHERE dbo_tblEvents.[Status] <> 'Cancelled' And dbo_tblEvents.[StartDate] = " & _
  8.            ctlDayBlock.Tag & " ORDER BY dbo_tblEvents.[StartDate];"
  9.  
  10. lstEvents.RowSource = strSQL2
  11.  
  12. lblEventsOnDate.Caption = Format(ctlDayBlock.Tag, "m-dd-yyyy")
  13. lstEvents.Visible = True
  14. lblEventsOnDate.Visible = True
  15.  
  16. Exit_PopulateEventsList:
  17.   Exit Sub
  18.  
  19. Err_PopulateEventsList:
  20.   MsgBox Err.Description, vbExclamation, "Error in PopulateEventsList()"
  21.   Resume Exit_PopulateEventsList
  22. End Sub
Jan 13 '10 #167
ADezii
8,834 Expert 8TB
Do you do what I requested in Post #197 and what did you come up with?

P.S. - Place the following Line off code anywhere within the PopulateEventsList() Procedure. It should accurately reflect the selected Day in the Calendar.
Expand|Select|Wrap|Line Numbers
  1. MsgBox CDate(ctlDayBlock.Tag)
Also, try (Re: Line 4):
Expand|Select|Wrap|Line Numbers
  1. strSQL2 = "SELECT dbo_tblEvents.[EventID] As [Event ID], dbo_tblEvents.[EventName] As [Event Name], dbo_tblEvents.[Location] As [Meeting Room], " & _ 
  2.           "dbo_tblEvents.[StartDate] As [Start Date], dbo_tblEvents.[EndDate] As [End Date]" & _ 
  3.            "FROM dbo_tblEvents WHERE dbo_tblEvents.[Status] <> 'Cancelled' And dbo_tblEvents.[StartDate] = " & _ 
  4.            CDate(ctlDayBlock.Tag) & " ORDER BY dbo_tblEvents.[StartDate];"
Jan 13 '10 #168
Thanks for your help thus far. I have been working on this for quite some time.

The screen shot below is what I get when I added the following code:
Expand|Select|Wrap|Line Numbers
  1. MsgBox CDate(ctlDayBlock.Tag) 


The MsgBox pops up and displays the date for the textbox that I have chosen; however the information in the listbox is still not accurate. In this example I chose 1/3/2010. The data is displayed correctly in the calendar, but the data for 1/5/2010 is displayed in the listbox at the bottom of the form.

The screen shot below is what I get when I added the following code:
Expand|Select|Wrap|Line Numbers
  1. strSQL2 = "SELECT dbo_tblEvents.[EventID] As [Event ID], dbo_tblEvents.[EventName] As [Event Name], dbo_tblEvents.[Location] As [Meeting Room], " & _  
  2.           "dbo_tblEvents.[StartDate] As [Start Date], dbo_tblEvents.[EndDate] As [End Date]" & _  
  3.            "FROM dbo_tblEvents WHERE dbo_tblEvents.[Status] <> 'Cancelled' And dbo_tblEvents.[StartDate] = " & _  
  4.            CDate(ctlDayBlock.Tag) & " ORDER BY dbo_tblEvents.[StartDate];" 


After adding this code, the listbox is not populated at all. In this example I chose 1/5/2010. The data is displayed in the calendar correctly, but no data was displayed in the list box.
Jan 13 '10 #169
ADezii
8,834 Expert 8TB
Try the following SQL Statement removing the Data Type Converter and adding the Date Delimiters (Reference Lines 4 and 5):
Expand|Select|Wrap|Line Numbers
  1. strSql2 = "SELECT dbo_tblEvents.[EventID] As [Event ID], dbo_tblEvents.[EventName] As [Event Name], & _
  2.            dbo_tblEvents.[Location] As [Meeting Room], " & _
  3.           "dbo_tblEvents.[StartDate] As [Start Date], dbo_tblEvents.[EndDate] As [End Date]" & _
  4.            "FROM dbo_tblEvents WHERE dbo_tblEvents.[Status] <> 'Cancelled' And dbo_tblEvents.[StartDate] = #" & _
  5.            ctlDayBlock.Tag & "# ORDER BY dbo_tblEvents.[StartDate];"
Jan 13 '10 #170
When I change the code to include lines 4 and 5 from the code snippet you provided, the listbox does not populate. It remains empty regardless of the date selection.
Jan 13 '10 #171
ADezii
8,834 Expert 8TB
What is the Data Type of [StartDate] in dbo_tblEvents within the SQL Server DB?
Jan 13 '10 #172
The datatype for StartDate is datetime in the SQL Server DB.
Jan 13 '10 #173
ADezii
8,834 Expert 8TB
I am actually at my wits end on this one. Since the correct Date is being returned by Access in ctlDayBlock.Tag, my only assumption is that SQL Server is incorrectly interpreting the Date. This is my only Option at this point, and the choice is yours. Send to me as an Attachment the Form containing the Calendar as well as dbo_tblEvents as an Access Table. I'll verify the code in Access, then attempt to Upgrade to SQL Server and see what happens. If you are willing to go this route, and patient, then send me the above requested items. I can do nothing else at this point.
Jan 13 '10 #174
I have attached a sample version of my database. The code works fine when using an access table. Wires seemed to get crossed when using SQL Server 2005 as the backend.

Again, thanks for all the time you have spent on this.
Attached Files
File Type: zip ConfCtr.zip (108.2 KB, 236 views)
Jan 13 '10 #175
ADezii
8,834 Expert 8TB
As previously indicated in Post #195, I am not running Access 2007. If you can, convert the DB to Access 2003 where I can work with it then Upgrade to SQL Server 2000 where hopefully the problem may still exist. Be advised that this will take a little time.
Jan 14 '10 #176
ADezii
8,834 Expert 8TB
This Band-aide should work until I find out what is actually going on here (Line 4 change):
Expand|Select|Wrap|Line Numbers
  1. strSQL2 = "SELECT dbo_tblEvents.[EventID] As [Event ID], dbo_tblEvents.[EventName] As [Event Name], dbo_tblEvents.[Location] As [Meeting Room], " & _ 
  2.           "dbo_tblEvents.[StartDate] As [Start Date], dbo_tblEvents.[EndDate] As [End Date]" & _ 
  3.            "FROM dbo_tblEvents WHERE dbo_tblEvents.[Status] <> 'Cancelled' And dbo_tblEvents.[StartDate] = " & _ 
  4.            (ctlDayBlock.Tag - 2) & " ORDER BY dbo_tblEvents.[StartDate];" 
  5.  
  6. lstEvents.RowSource = strSQL2 
Jan 14 '10 #177
My apologies...I have uploaded the database in an earlier version. I will try the code from the last post to see if it works.

Again, thanks for your help on this.
Attached Files
File Type: zip ConfCtr.zip (65.7 KB, 223 views)
Jan 14 '10 #178
The Band-aid listed in post #208 worked. The list box at the bottom of the screen populates correctly...matching the date chosen in the calendar.
Jan 14 '10 #179
ADezii
8,834 Expert 8TB
I actually duplicated the problem with Access 2003/SQL Server 2000 and the Northwind.dbf Database. I'll look into it when I get the chance.
Jan 14 '10 #180
ADezii
8,834 Expert 8TB
Hello nerd4access. I hope you don't mind but I made some cosmetic as well as a single functional modification to your Calendar Form to make it more visually appealing. You can either accept some/all of them, or disregard, the choice is yours. The major problem I'll look at later.
  1. Eliminated the Vertical Scroll Bar which is not needed, and is not visually appealing.
  2. Set the Border Style of frmCalendar to Dialog.
  3. The sequence of Events in the Events List Box should be in the same order as they are displayed in the Calendar. I simple added another Order By to the existing one.
  4. Set the Moveable Property to No.
  5. Changed the Foreground/Background Properties of the System Date Block to make it stand out more.
  6. All these changes are reflected in the Attachment.
Jan 14 '10 #181
I like the cosmetic changes. I would agree that they are more appealing to the eye. Thanks for those touch ups.
Jan 15 '10 #182
edsuk
10
I have been asked to provide a calendar facility within an Access database. I have looked at a number of threads on this subject and Adezii has included a database as an attachment.

If an Access 2000 or 2002 version could be attached it would really be appreciated.

Thanks in advance for any help you are able to provide.
Jan 22 '10 #183
ADezii
8,834 Expert 8TB
Will your Database be displaying info for a Single Date Field as in [Review Date], or within a Date Range as in [Start Date] ==> [End Date]? There are actually 2 Calendar Databases, one for each scenario.
Jan 22 '10 #184
It will display info for a single date.
Jan 22 '10 #185
ADezii
8,834 Expert 8TB
I'm confused, are nerd4access and edsuk one and the same? Oh well:
Jan 22 '10 #186
We are not one in the same, but it's okay. I will view the attachment in your last post. Thank you so much for your help! :-)
Jan 22 '10 #187
edsuk
10
Hi ADezii

We are definitely not the same !

Thanks for replying on this subject. I have spent ages trying to find a solution like this. Actually the calendar option I would prefer is the 'Date Range' option where the task can span a number of days or even may be just the one day.

As mentioned a version in Access 2000 or 2002 would be so much appreciated.

Once again, thanks.
Jan 22 '10 #188
ADezii
8,834 Expert 8TB
Let me explain how the Date Range Calendar works. Let's suppose you have an Event named Event A and the Start Date for Event A is 1/10/2010 while the End date is 1/20/2010. Info relating to Event A will be displayed linearly on the Calendar for each Day of the Range. Why not give me your Start and End Date Field Names, as well as additional Field Names, and I'll construct a simple Demo for you. Include your Table name also. Keep in mind that the actual info than can be displayed in the Calendar itself is very limited, which is why it incorporates a List Box for expanded info.
Jan 22 '10 #189
ADezii
8,834 Expert 8TB
As soon as I get the details from edsuk as previously requested in Post #219, I'll post a simple Demo for both of you to Download. In the meantime, yoou can download the Single-Date Calendar that I attached in Post #217.
Jan 22 '10 #190
edsuk
10
Hi ADezii

Missed your earlier reply due to time difference, UK vs USA.

Anyway, really appreciate your offer to help, the data is held in only two tables, I have only included relevant columns:

T_Job:
JobID PK
JobNo
EmpID FK
StartDate
ReqDate

T_Emp
EmpID PK
EmpName


T_Job
24 'JN132' 204 '10/01/2010' '15/01/2010'
25 'JN135' 207 '11/01/2010' '11/01/2010'

T_Emp
204 Bob Smith
207 Will Jones

Only one employee can be assigned to a job.

I am use to working with recordsets, so the additional data requirements I can probably sort once I have the example Db, as well as populating the listbox - and I fully understand the requirement for this - to supplement the info displayed in the calendar iteself. As mentioned previously a calendar with this type of functionalty is so hard to find/let alone code. And I am so thankful for your help.

edsuk...
Jan 23 '10 #191
ADezii
8,834 Expert 8TB
Hello edsuk. It is not that simple a Task to recode the Calendar to conform exactly to specific requirements. I'll start the process in my spare time, but you must be patient. I'll also generate additional Dummy Data for display purposes. See Ya when I see Ya or I'll Be Back! (LOL)
Jan 23 '10 #192
edsuk
10
ADezii

Thanks for the update, I am not asking you to do my coding for me, you have done the 'hard work' already in providing the calendar/schedule functionality.

I can modify the code for populating the calendar controls and the list box myself.

I have been searching for a long time for an Access calendar like this and am so grateful that you have provided this for others to use.

Once done I will be glad to attach my slightly modified sample Db in another post for reference.

So if you could attach the 'Date Range' calendar in your next post I will get on and do my small bit.

You must realize how useful this calendar form is from the number of posts on this subject, which continue to grow.

Cheers buddy.
Jan 23 '10 #193
ADezii
8,834 Expert 8TB
Will send a Demo as soon as I can. Just as a side not, edsuk, it is rarely a good idea to store a Full Name in a single Field as in [EmpName].
Jan 23 '10 #194
edsuk
10
ADezii

Totally agree and I don't. The table actually has EmployeeFirstName and EmployeeLastName as columns. Plus the full name which is not displayed in the form but gets updated when either of these two records get data entered/modified.

Having the full name in addition does make displaying the information easier when it comes to combo boxes, list boxes etc as saves having to concatenate the data every time I write a query [I'm just a bit lazy LOL].

Space is not an issue so the additional column is not a problem.

Cheers
Jan 23 '10 #195
ADezii
8,834 Expert 8TB
Download the Attachment for what I feel is a workable Demo which you can tweak to your own needs. Be advised that you may have to swap Code Lines 21 and 26, since you are in the UK. Only you can make that determination. Good Luck and let me know how you make out.
Expand|Select|Wrap|Line Numbers
  1. Private Sub PopulateCalendar()
  2. On Error GoTo Err_PopulateCalendar
  3. Dim strFirstOfMonth As String, bytFirstWeekdayOfMonth As Byte, bytBlockCounter As Byte
  4. Dim bytBlockDayOfMonth As Byte, lngBlockDate As Long, ctlDayBlock As Control
  5. Dim bytDaysInMonth As Byte, bytEventDayOfMonth As Byte, lngFirstOfMonth As Long
  6. Dim lngLastOfMonth As Long, lngFirstOfNextMonth As Long, lngLastOfPreviousMonth As Long
  7. Dim lngEventDate As Long, bytBlankBlocksBefore As Byte, bytBlankBlocksAfter As Byte
  8. Dim astrCalendarBlocks(1 To 42) As String, db As Database, rstEvents As Recordset
  9. Dim strSelectEvents As String, strEvent As String, strPlatoons As String
  10. Dim lngSystemDate As Long  'CFB added 1-25-08
  11. Dim ctlSystemDateBlock As Control, blnSystemDateIsShown As Boolean  'CFB added 1-25-08
  12. Dim strSQL As String    'Added 4/16/2008
  13. Dim blnRetVal, intNumOfRecs As Integer
  14.  
  15. lngSystemDate = Date    'CFB added 1-25-08
  16. intMonth = objCurrentDate.Month
  17. intYear = objCurrentDate.Year
  18. lstEvents.Visible = False
  19. lblEventsOnDate.Visible = False
  20. lblMonth.Caption = MonthAndYear(intMonth, intYear)
  21. strFirstOfMonth = Str(intMonth) & "/1/" & Str(intYear)
  22.  
  23. '*************************************************************************
  24.   'ADezii
  25.   'NOTE: Will work in the UK (United Kingdom) and other European Nations
  26.   'strFirstOfMonth = "1/" & Str(intMonth) & Str(intYear)
  27. '*************************************************************************
  28.  
  29. bytFirstWeekdayOfMonth = WeekDay(strFirstOfMonth)
  30. lngFirstOfMonth = DateSerial(intYear, intMonth, 1)
  31. lngFirstOfNextMonth = DateSerial(intYear, intMonth + 1, 1)
  32. lngLastOfMonth = lngFirstOfNextMonth - 1
  33. lngLastOfPreviousMonth = lngFirstOfMonth - 1
  34. bytDaysInMonth = lngFirstOfNextMonth - lngFirstOfMonth
  35. bytBlankBlocksBefore = bytFirstWeekdayOfMonth - 1
  36. bytBlankBlocksAfter = 42 - (bytBlankBlocksBefore + bytDaysInMonth)
  37.  
  38. Set db = CurrentDb
  39. strSQL = "Select * From tbl_employees_TEMP Where tbl_employees_TEMP.[LeaveDateFrom] Between " & _
  40.           lngFirstOfMonth & " And " & lngLastOfMonth & " ORDER BY tbl_employees_TEMP.[LeaveDateFrom], " & _
  41.           "tbl_employees_TEMP.[FullName];"
  42.  
  43. Set rstEvents = db.OpenRecordset(strSQL)    'Added 4/16/2008
  44.  
  45. Do While Not rstEvents.EOF
  46.   strEvent = rstEvents![FullName]
  47.   bytEventDayOfMonth = (rstEvents![LeaveDateFrom] - lngLastOfPreviousMonth)
  48.   bytBlockCounter = bytEventDayOfMonth + bytBlankBlocksBefore
  49.     If astrCalendarBlocks(bytBlockCounter) <> "" Then
  50.       astrCalendarBlocks(bytBlockCounter) = _
  51.       astrCalendarBlocks(bytBlockCounter) & vbNewLine & strEvent
  52.     Else
  53.       astrCalendarBlocks(bytBlockCounter) = strEvent
  54.     End If
  55.     rstEvents.MoveNext
  56. Loop
  57.  
  58. For bytBlockCounter = 1 To 42                       'blank blocks at start of month
  59.   Select Case bytBlockCounter
  60.     Case Is < bytFirstWeekdayOfMonth
  61.       astrCalendarBlocks(bytBlockCounter) = ""
  62.       ReferenceABlock ctlDayBlock, bytBlockCounter
  63.       ctlDayBlock.BackColor = 12632256
  64.       ctlDayBlock = ""
  65.       ctlDayBlock.Enabled = False
  66.       ctlDayBlock.Tag = ""
  67.     Case Is > bytBlankBlocksBefore + bytDaysInMonth 'blank blocks at end of month
  68.       astrCalendarBlocks(bytBlockCounter) = ""
  69.       ReferenceABlock ctlDayBlock, bytBlockCounter
  70.       ctlDayBlock.BackColor = 12632256
  71.       ctlDayBlock = ""
  72.       ctlDayBlock.Enabled = False
  73.       ctlDayBlock.Tag = ""
  74.         If bytBlankBlocksAfter > 6 And bytBlockCounter > 35 Then
  75.           ctlDayBlock.Visible = False
  76.         End If
  77.     Case Else   'blocks that hold days of the month
  78.       bytBlockDayOfMonth = bytBlockCounter - bytBlankBlocksBefore
  79.       ReferenceABlock ctlDayBlock, bytBlockCounter
  80.       lngBlockDate = lngLastOfPreviousMonth + bytBlockDayOfMonth 'block's date
  81.         If bytBlockDayOfMonth < 10 Then
  82.           ctlDayBlock = Space(2) & bytBlockDayOfMonth & _
  83.                         vbNewLine & astrCalendarBlocks(bytBlockCounter)
  84.         Else
  85.           ctlDayBlock = bytBlockDayOfMonth & _
  86.                         vbNewLine & astrCalendarBlocks(bytBlockCounter)
  87.         End If
  88.  
  89.         'If this block is the system date, change its color (CFB 1-25-08)
  90.         If lngBlockDate = lngSystemDate Then
  91.           ctlDayBlock.BackColor = QBColor(13)
  92.           ctlDayBlock.ForeColor = QBColor(15)
  93.           Set ctlSystemDateBlock = ctlDayBlock
  94.           blnSystemDateIsShown = True
  95.         Else
  96.           ctlDayBlock.BackColor = 16777215
  97.           ctlDayBlock.ForeColor = 8388608 '====> Added by ADezii on 1/28/2008 (Date
  98.         End If                                  'Text was essentially invisible without it for
  99.           ctlDayBlock.Visible = True            'Block representing current day position)
  100.           ctlDayBlock.Enabled = True
  101.           ctlDayBlock.Tag = lngBlockDate
  102.   End Select
  103. Next
  104.  
  105. 'If the system date is in this month, show its events (CFB added 1-25-08)
  106. If blnSystemDateIsShown Then
  107.   PopulateEventsList ctlSystemDateBlock
  108. End If
  109.  
  110. Call PopulateYearListBox    'Added by ADezii on 1/28/2008 - suggested by CFB
  111.  
  112. Exit_PopulateCalendar:
  113.   Exit Sub
  114. Err_PopulateCalendar:
  115.   MsgBox Err.Description, vbExclamation, "Error inPopulateCalendar()"
  116.   Resume Exit_PopulateCalendar
  117. End Sub
Jan 23 '10 #196
NeoPa
32,556 Expert Mod 16PB
Space is not an issue so the additional column is not a problem.
If that's your opinion, then I strongly recommend checking out Normalisation and Table structures. You won't find many experienced database professionals who agree with you.
Jan 24 '10 #197
edsuk
10
ADezii

Thanks for the Calendar Db, exactly what was required. Really appreciate all your help.

And regarding the comments from NeoPa, thanks and yes I do understand Normalisation and Table Structures and agree that this goes against the grain, but the EmployeeTbl has less than 20 records - so I stand by my comment that space is not an issue in this particular Db.

Cheers and thanks ADezii once again.
Jan 25 '10 #198
edsuk
10
hi ADezii

I have made one very insignifficant mod to the populateCalendar sub.

Which you may like or not to include in the future.

the mod is at line 74

Currently:
Expand|Select|Wrap|Line Numbers
  1. If bytBlankBlocksAfter > 6 And bytBlockCounter > 35 Then
  2.    ctlDayBlock.Visible = False
  3. End If
Amended To:
Expand|Select|Wrap|Line Numbers
  1. If bytBlankBlocksAfter > 6 And bytBlockCounter > 35 Then
  2.    ctlDayBlock.Visible = False
  3. Else
  4.    ctlDayBlock.Visible = True
  5. End If
If you scroll through the months, say to May 2010, we get an incomplete row at the bottom as only the first two textboxes are visible. This mod just makes the whole of the bottom row visible to complete the grid.

I did say it was insignifficant.

this sample DB is great - thanks.
Jan 25 '10 #199
NeoPa
32,556 Expert Mod 16PB
As an alternative (same effect - different code) you could say :
Expand|Select|Wrap|Line Numbers
  1. ctlDayBlock.Visible = ((bytBlankBlocksAfter < 7) Or (bytBlockCounter < 36))
Jan 25 '10 #200

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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...
8
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?
3
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...
5
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...
1
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....
1
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...
16
rcollins
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...
76
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
Oralloy
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,...
0
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...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.