I have code to call an Access function from Outlook when a new mail item is added to a specific folder. The Access database is always open when Outlook is open.
Public WithEvents myOlItems As Outlook.Items
Public Sub Application_Startup()
Set myOlItems = Application.GetNamespace("Mapi").Folders("Mailbox - Media Center").Folders("Inbox").Folders("Accepted Calls").Items
Public Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim acApp As Access.Application
Set acApp = GetObject(, "Access.Application")
In Access I have
Public Sub Out_Check()
Call Forms("Enter Calls").Check_Mail_Click
When I first test the code it runs fine, but if I go back later and try it I get a 7952 "You have made an illegal function call" in Outlook at
I can't figure out why it runs OK if I redo it, but then starts giving the error again after a while.