Format time to display hh:mm AM/PM in the calendar block area

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

    #1

    Format time to display hh:mm AM/PM in the calendar block area

    I have another question re: Access Calendar, Wide Calendar w/Switchboard.

    Currently the time format in the calendar block, display like 03:00:00 PM, Hour:Minutes:Se conds AM/PM.

    Even though the code below appears to be formated Not to display seconds, time is still displayed as noted above.

    Code:
    strEventTime = Format(strStartTime, "h:mm AM/PM")
    I looked at another code, below... Modified it, and still no change!
    Code:
    Me.Caption = "Access Calendar (" & Format$(Now(), "dddd - mmmm dd, yyyy hh:mm:ss AM/PM") & ")"
    The query returns the correct format in the details section for each appointment, so it is not the query that need re-formating.

    How do I re-format the time to display only hh:mm AM/PM in the calendar block area? Is it possible?
    Last edited by NeoPa; Nov 11 '11, 10:46 PM. Reason: Added mandatory [CODE] tags for you
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Originally posted by Edward Polite
    Edward Polite:
    How do I re-format the time to display only hh:mm AM/PM in the calendar block area?
    What exactly is the calendar block area?

    Whatever it is, I suspect you need to look at the format property for it. You can use the Format() function to effect the actual data stored there, but that has no real effect on what is displayed. That is reserved for the .Format property. A different animal completely.

    Let us know how you get on with this.

    Comment

    • Edward Polite
      New Member
      • Oct 2011
      • 9

      #3
      NeoPa, I followed your lead, and it took some time to figure it all out, but I modified lines 3 & 5 below by inserting the following code (Format(rstEven ts![Start Time], "h:mm AMPM")) to get the results I was looking for in the "txtDayBloc k" areas. Thank you for pointing me in the right direction!

      Code:
      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
      Last edited by NeoPa; Nov 17 '11, 10:52 PM. Reason: Added mandatory [CODE] tags for you

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Ah. I see the [txtDayBlock] areas are string titles that simply want to include the formatted time values. In that case you have a good solution :-)

        Comment

        Working...