asked on
ASKER
ASKER
That macro was meant to be used on a contacts "Form"I can't imagine how you figured this out. Access help disavows any knowledge of the macro.
Function AddOlContact()
On Error GoTo Error_Handler
Const olContactItem = 2
Dim olApp As Object
Dim Ctct As Object
Set olApp = CreateObject("Outlook.Application")
Set olContact = olApp.CreateItem(olContactItem)
With olContact
.FirstName = "Daniel"
.LastName = "Alba"
.JobTitle = ""
.CompanyName = "MINI CARDA"
.BusinessAddressStreet = "22 ClearPoint"
.BusinessAddressCity = "Pointe-Claire"
.BusinessAddressState = "Quebec"
.BusinessAddressCountry = "Canada"
.BusinessAddressPostalCode = "H9X 3A6"
.BusinessTelephoneNumber = "(514) 488-0956"
.BusinessFaxNumber = ""
.Email1Address = "mini@mini.com"
.MobileTelephoneNumber = ""
.Save 'use .Display if you wish the user to see the contact pop-up
End With
Error_Handler_Exit:
On Error Resume Next
Set olContact = Nothing
Set olApp = Nothing
Exit Function
Error_Handler:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & _
Err.Number & vbCrLf & "Error Source: AddOlContact" & vbCrLf & "Error Description: " & _
Err.Description, vbCritical, "An Error has Occured!"
Resume Error_Handler_Exit
End Function
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
I'm sure I am missing something in your question but i don't have enough information to provide a better answer.