1 hour meeting time

G

Guest

I'm trying to set up the end time for an appointment as 1 hr more to have 1
hr meeting (not 30 min as a default).
.Start = dtStartDate & " " & dtStartTime ' it's working
dtEndTime = dtEndTime + 1
.End = dtStartDate & " " & dtEndTime ' error
Could anybody help me how to do it?

Thanks
 
D

Dmitry Streblechenko

Why are you using strings instead of datetime? if dtEndTime is "10:30pm",
dtEndTime + 1
will be a "10:30pm1" srting, which makes no sense.
Also, adding 1 to a datetime variable adds 24 hours. One hour is 1/24.
Try
..End = .Start + 1/24

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
G

Guest

This is where Date functions come in handy:

objAppt.End = DateAdd("h", 1, objAppt.Start)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top