Wide Calendar w/Switchboard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Edward Polite
    New Member
    • Oct 2011
    • 9

    Wide Calendar w/Switchboard

    This question references MS Access Calendar.

    I recently downloaded the "Wide Calendar w/Switchboard" database that I found on this forum and it is exactly what I have been searching online for. I have read through most the thread looking for an answer to my question, but have not found one.

    I plan on using the 'Training_Event s' form to input data into the calendar. Currently the data that is displayed in the calendar comes from the [Title] & [Start Time] fields.

    My question is, How do I string the [Title], [Start Time] & [End Time] fields into the calendar? And, if it is possible to input these fields on the calendar, how is that done? Thank you for your reply.

    Thank you!

    I hope I have made my question clear, I am new to Access but I am able understand
    Last edited by NeoPa; Oct 26 '11, 10:05 PM. Reason: Added link to Calendar thread
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    The actual population of the Calendar Day Blocks occurs within a specific Code segment in the PopulateCalenda r() Sub-Routine in the frmCalendar's Code Module. In your case, it should look something like this (Code Lines 6 to 7, 9 to 11):
    Code:
    '************************************** Code intentionally omitted **************************************
    For lngEachDateInRange = lngFirstDateInRange To lngLastDateInRange
      bytEventDayOfMonth = (lngEachDateInRange - lngLastOfPreviousMonth)
      bytBlockCounter = bytEventDayOfMonth + bytBlankBlocksBefore
       If astrCalendarBlocks(bytBlockCounter) = "" Then      'no existing Text in Array
         astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & " - " & rstEvents![Start Time] & " - " & _
                                               rstEvents![End Time]
       Else
         astrCalendarBlocks(bytBlockCounter) = astrCalendarBlocks(bytBlockCounter) & vbNewLine & _
                                               rstEvents![Title] & " - " & rstEvents![Start Time] & _
                                               " - " & rstEvents![End Time]
       End If
    Next lngEachDateInRange
    '************************************** Code intentionally omitted **************************************

    Comment

    • Edward Polite
      New Member
      • Oct 2011
      • 9

      #3
      Thank you for your reply. I modified the code as you suggested and it works really well. No problems at all!! I really appreciate all the time and effort you put into answering these questions.

      If you don't mind, I have another related question. Is it possible to insert the [Title] & [Start Time]into let's say October 16, 2011 calendar block, And then insert the [Title] and [END Time] fields into the October 20, 2011 calendar block, without [Start Time] or [End Time] in blocks, 17, 18 and 19?

      I thought about using If statements after code lines 6 & 7. Is that possible?

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        @Edward Polite: Off the Top-of-my-Head, the Code would be:
        Code:
        For lngEachDateInRange = lngFirstDateInRange To lngLastDateInRange
          bytEventDayOfMonth = (lngEachDateInRange - lngLastOfPreviousMonth)
          bytBlockCounter = bytEventDayOfMonth + bytBlankBlocksBefore
           If astrCalendarBlocks(bytBlockCounter) = "" Then      'no existing Text in Array
             Select Case lngEachDateInRange
               Case lngFirstDateInRange         '1st Date in Range, no existing Text
                 astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & " - " & rstEvents![Start Time]
               Case lngLastDateInRange          'Last Date in Range, no existing Text
                 astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & " - " & rstEvents![End Time]
               Case Else                        'Date Between 1st and Last in Range, no existing Text
                 astrCalendarBlocks(bytBlockCounter) = rstEvents![Title]
             End Select
           Else
             Select Case lngEachDateInRange
               Case lngFirstDateInRange         '1st Date in Range, existing Text
                 astrCalendarBlocks(bytBlockCounter) = astrCalendarBlocks(bytBlockCounter) & vbNewLine & _
                                                       rstEvents![Title] & " - " & rstEvents![Start Time]
               Case lngLastDateInRange          'Last Date in Range, existing Text
                 astrCalendarBlocks(bytBlockCounter) = astrCalendarBlocks(bytBlockCounter) & vbNewLine & _
                                                       rstEvents![Title] & " - " & rstEvents![End Time]
               Case Else                        'Date Between 1st and Last in Range, existing Text
                 astrCalendarBlocks(bytBlockCounter) = astrCalendarBlocks(bytBlockCounter) & vbNewLine & _
                                                       rstEvents![Title]
             End Select
           End If
        Next lngEachDateInRange
        P.S. - I'm sure that the Code can be condensed in some manner.

        Comment

        • Edward Polite
          New Member
          • Oct 2011
          • 9

          #5
          Good Morning ADezii,

          Wow! Off the top of your head, your a blessing man! I will get to work on this and let you know how things turn out. Pointing out the calendar population section of the code has been insightful and has made understanding the db and its functions a lot easier.

          Thank you!

          Comment

          • Edward Polite
            New Member
            • Oct 2011
            • 9

            #6
            Good Morning ADezii,

            I am finished!! The code worked perfectly! Maybe the code can be condensed, but right now the coding is fine.

            Hats off to all MS Access Experts, what a wonderful group of people you all are!!

            Thank you!!!

            Comment

            • ADezii
              Recognized Expert Expert
              • Apr 2006
              • 8834

              #7
              @Edward Polite:
              Glad you are enjoying the Ms Access Calendar. This Application has been extremely popular over the years, and I have made many modifications to it, usually adapting it to specific needs. I wish to again state for the Record that I am not the Original Author of this Concept, but have been given by him full permission to modify and distribute it in any manner I see fit. I also would like to state that NeoPa has also been very instrumental in providing the Final Version of the Code for this Calendar. His insights are invaluable, always welcome, and greatly appreciated.

              Comment

              • Edward Polite
                New Member
                • Oct 2011
                • 9

                #8
                I agree. Kudos to the original author and NeoPa as well!

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32645

                  #9
                  Well there's my first question answered. It's not just your name :-D

                  Comment

                  Working...