Sending Outlook Appointments via Access

Samantha

still learning...
Local time
Today, 09:48
Joined
Jul 12, 2012
Messages
182
Hi all, I am using a windows 7 64-bit operating system with Access 2010.
I have the following borrowed code attached to a button on my form that sends the meeting to my calender and invites others to the appointment. There is a error being thrown at .Start the date goes in correctly however the time does not. I have tried many variations of this line suggested here as well as http://support.microsoft.com/kb/209963. I should also add that [Pre-BidTime] is a Medium Date/Time Field however now that I have said that it is a lookup field in the underlying table, so that is probably where my problem is. I a going to continue thinking this through although if someone has a suggestion I'd be appreciative. :o

Code:
Private Sub cmdPrebidMeeting_Click()
   ' On Error GoTo Add_Err

    If Me.Dirty Then
        Me.Dirty = False
    End If

Dim olapp As Object
Dim olappt As Object
Set olapp = Outlook.Application
Set olappt = olapp.CreateItem(olAppointmentItem)

With olappt
.Subject = "Bid Due - " & ([Company] + Nz(" -" + [EngineerArchitectCompany]))
.Location = [ServiceAddress] & " - " & [ProjectDescription]
.RequiredAttendees = "s@something.net"
.Duration = "60"
[COLOR="Red"].Start = Nz(Me![Pre-BidDate], "") & "" & Nz(Me![Pre-BidTime], "")[/COLOR]
.Categories = "Yellow Category"
.Display
End With
Set olappt = Nothing
Set olapp = Nothing
MsgBox "Appointment Added!", vbInformation

'Add_Err:
 '   MsgBox "Error " & Err.Number & vbCrLf & Err.Description
  '  Exit Sub
End Sub
 
Update: So I went back and changed the table for the field in question to a Date/Time field formatted as Medium Time and now I am receiving an error message "Run time error -2147352571 Type Mismatch: cannot coerce parameter value. Outlook cannot translate your string." :confused:
 
I ended up figuring the problem out I was missing a space in between the quotes where the underscore now is.
.Start = Nz(Me![Pre-BidDate], "") & "_" & Nz(Me![Pre-BidTime], "")
 

Users who are viewing this thread

Back
Top Bottom