By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,968 Members | 1,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,968 IT Pros & Developers. It's quick & easy.

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

P: 9
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:Seconds AM/PM.

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

Expand|Select|Wrap|Line Numbers
  1. strEventTime = Format(strStartTime, "h:mm AM/PM")
I looked at another code, below... Modified it, and still no change!
Expand|Select|Wrap|Line Numbers
  1. 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?
Nov 3 '11 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,709
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.
Nov 11 '11 #2

P: 9
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(rstEvents![Start Time], "h:mm AMPM")) to get the results I was looking for in the "txtDayBlock" areas. Thank you for pointing me in the right direction!

Expand|Select|Wrap|Line Numbers
  1. Select Case lngEachDateInRange
  2. Case lngFirstDateInRange        '1st Date in Range, no existing Text
  3.     astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & " - " & rstEvents![Start Time]
  4. Case lngLastDateInRange         'Last Date in Range, no existing Text
  5.     astrCalendarBlocks(bytBlockCounter) = rstEvents![Title] & " - " & rstEvents![End Time]
  6. Case Else                       'Date Between 1st and Last in Range, no existing Text
  7.     astrCalendarBlocks(bytBlockCounter) = rstEvents![Title]
  8. End Select
Nov 17 '11 #3

NeoPa
Expert Mod 15k+
P: 31,709
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 :-)
Nov 17 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.