PDA

View Full Version : [SOLVED:] End Time of Event



missbutters
07-16-2014, 05:39 AM
I'm trying to write a macro that will flag an event with a category if the end time is past 5pm. Can someone show me how to separate out the just the time from the appointment end date/time, and then how to compare if it's less than 5pm?

Basically I need code for something like:
if time(end time) >"05:00:00 pm" then ...

Thank you so much!

westconn1
07-16-2014, 05:59 AM
try like

mytime = Format(i.End, "hh:nn:ss AM/PM")
If TimeValue(mytime) > TimeValue("5:00:00 PM") Then msgbox "Appointment ends late"where i is an appointment item