[AccessD] Interesting VBA problem

John W Colby jwcolby at gmail.com
Wed Oct 16 08:23:51 CDT 2013


Mark,

>>Dim oSync as Access.CustomControl

The problem is that you missed the Withevents keyword. Withevents notifies the compiler that this class will be sinking events for the dimensioned object.  My guess is that as soon as you add Withevents to the dimension statement the compiler will complain that it can't sink events for that object.  Or, if Access.CustomControl actually has events you can sync, you will not have the specific event that you want to sink.

John W. Colby

Reality is what refuses to go away
when you do not believe in it

On 10/16/2013 8:45 AM, Mark Simms wrote:
> I've got an AC2010 app that must use late-binding.
> I'm an instantiating an Outlook session.
> However, I need to reference a SyncObject WithEvents.
> However, what do I Dim it as ?
> Private oSync WithEvents as Outlook.SyncObject
>
> Tried Private oSync WithEvents as EventObject
> By the compiler complained !
>
> Dim oSync as Access.CustomControl
>
> That worked, but the call back will probably fail, correct ?
>
> Someone said it might work if I:
> Set oSync = CreateObject("Outlook.SyncObject")
>
>
>



More information about the AccessD mailing list