Outlook automation

npsavidge

Registered User.
Local time
Today, 15:24
Joined
Oct 28, 2009
Messages
15
Hi

I am using the following code to set a date and time for an outlook appointment created from an access db

.Start = "#" & Format(dtDate, "dd/mm/yyyy") & " " & Format(dtTime, "hh:mm:ss") & "#"

I have ran my code with a start time on 10am, 2pm and 4.30pm, but my code seems to put them in the right day, but all starting at 3.30.

Can anyone advise on the possible issues?

Thanks in advance
 
Unfortunately, I can't provide an immediate solution. A couple of observations, it seems that you should be using: "now()". It seems unnecessarily complex to have dtDate and dtTime as you can get that directly from "now()". Do a search in access help using "Calculate Elapsed Time" Access help writes "This topic explains how Microsoft Access stores the Date/Time data type and why you may receive unexpected results when you calculate or compare dates and times."
 
I am interested in using a similar functionality, can you post your code so that I can learn from it too.

I have a contacts database, for each client, staff sets reminders in access, however if these can be interfaced with outlook that would be great.

Regards
 
It is always a good idea to read what Microsoft has written - as a learner myself I must admit I usually do not understand it at first - http://msdn.microsoft.com/en-au/library/aa212409(office.11).aspx

From my understanding the below code will accept any date format and time format and give it to the .Start as Outlook is expecting.
Code:
.Start = Format(Me.txt_start, "Short Date") & " " & Format(Me.txt_starttime, "Short Time")
Just in case you need it this is how I read appointment items and get the date and time back - the format that it will appear in the users txtbox will depend on their regional settings.

Code:
Me.txt_start = Format(.Start, "Short Date")
             
        Me.txt_starttime = Format(.Start, "Short Time")
 

Users who are viewing this thread

Back
Top Bottom