Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

WithEvents syntax

Discussion in 'Information Technology' started by Chubbly Geezer, Jul 28, 2006.

  1. Chubbly Geezer

    Chubbly Geezer
    Expand Collapse
    Guest

    Hi

    I have written a DLL that raise several events. I want to use this DLL and
    the associated events within Access 2003 but cannot seem to find the correct
    syntax of the WithEvents.

    In VB I would just dim the dll using the Withevents and then the events
    would appear in the procedure list which I could select and use.

    This is not the case in Access. Any ideas please.

    Chubbly
     
  2. Jon Lewis

    Jon Lewis
    Expand Collapse
    Guest

    If you declare an instance of a Class in Access VBA with the following
    syntax:

    Dim WithEvents Something As clsMyClass

    in the declarations section of the relevant module, the Public Events of the
    class definitely appear in the procedures list

    Does this help?


    "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    > Hi
    >
    > I have written a DLL that raise several events. I want to use this DLL
    > and the associated events within Access 2003 but cannot seem to find the
    > correct syntax of the WithEvents.
    >
    > In VB I would just dim the dll using the Withevents and then the events
    > would appear in the procedure list which I could select and use.
    >
    > This is not the case in Access. Any ideas please.
    >
    > Chubbly
    >
     
  3. Chubbly Geezer

    Chubbly Geezer
    Expand Collapse
    Guest

    Well that's what I thought, but they don't.

    Could it be that I am using a .Net dll via a tlb file?

    My declaration is in the declarations section and looks fine

    Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation



    "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    > If you declare an instance of a Class in Access VBA with the following
    > syntax:
    >
    > Dim WithEvents Something As clsMyClass
    >
    > in the declarations section of the relevant module, the Public Events of
    > the class definitely appear in the procedures list
    >
    > Does this help?
    >
    >
    > "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    > news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >> Hi
    >>
    >> I have written a DLL that raise several events. I want to use this DLL
    >> and the associated events within Access 2003 but cannot seem to find the
    >> correct syntax of the WithEvents.
    >>
    >> In VB I would just dim the dll using the Withevents and then the events
    >> would appear in the procedure list which I could select and use.
    >>
    >> This is not the case in Access. Any ideas please.
    >>
    >> Chubbly
    >>

    >
    >
     
  4. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    have you added a reference to the dll?
    open Module/tools/references

    Pieter

    "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    > Well that's what I thought, but they don't.
    >
    > Could it be that I am using a .Net dll via a tlb file?
    >
    > My declaration is in the declarations section and looks fine
    >
    > Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >
    >
    >
    > "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    > news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >> If you declare an instance of a Class in Access VBA with the following
    >> syntax:
    >>
    >> Dim WithEvents Something As clsMyClass
    >>
    >> in the declarations section of the relevant module, the Public Events of
    >> the class definitely appear in the procedures list
    >>
    >> Does this help?
    >>
    >>
    >> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>> Hi
    >>>
    >>> I have written a DLL that raise several events. I want to use this DLL
    >>> and the associated events within Access 2003 but cannot seem to find the
    >>> correct syntax of the WithEvents.
    >>>
    >>> In VB I would just dim the dll using the Withevents and then the events
    >>> would appear in the procedure list which I could select and use.
    >>>
    >>> This is not the case in Access. Any ideas please.
    >>>
    >>> Chubbly
    >>>

    >>
    >>

    >
    >
     
  5. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    have you added a reference to the dll?
    open Module/tools/references

    Pieter

    "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    > Well that's what I thought, but they don't.
    >
    > Could it be that I am using a .Net dll via a tlb file?
    >
    > My declaration is in the declarations section and looks fine
    >
    > Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >
    >
    >
    > "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    > news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >> If you declare an instance of a Class in Access VBA with the following
    >> syntax:
    >>
    >> Dim WithEvents Something As clsMyClass
    >>
    >> in the declarations section of the relevant module, the Public Events of
    >> the class definitely appear in the procedures list
    >>
    >> Does this help?
    >>
    >>
    >> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>> Hi
    >>>
    >>> I have written a DLL that raise several events. I want to use this DLL
    >>> and the associated events within Access 2003 but cannot seem to find the
    >>> correct syntax of the WithEvents.
    >>>
    >>> In VB I would just dim the dll using the Withevents and then the events
    >>> would appear in the procedure list which I could select and use.
    >>>
    >>> This is not the case in Access. Any ideas please.
    >>>
    >>> Chubbly
    >>>

    >>
    >>

    >
    >




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4285 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  6. Chubbly Geezer

    Chubbly Geezer
    Expand Collapse
    Guest

    Yep. Well a reference to the tlb file.

    "Pieter Wijnen"
    <it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
    wrote in message news:OzTg6exqGHA.2256@TK2MSFTNGP03.phx.gbl...
    > have you added a reference to the dll?
    > open Module/tools/references
    >
    > Pieter
    >
    > "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    > news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    >> Well that's what I thought, but they don't.
    >>
    >> Could it be that I am using a .Net dll via a tlb file?
    >>
    >> My declaration is in the declarations section and looks fine
    >>
    >> Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >>
    >>
    >>
    >> "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    >> news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >>> If you declare an instance of a Class in Access VBA with the following
    >>> syntax:
    >>>
    >>> Dim WithEvents Something As clsMyClass
    >>>
    >>> in the declarations section of the relevant module, the Public Events of
    >>> the class definitely appear in the procedures list
    >>>
    >>> Does this help?
    >>>
    >>>
    >>> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >>> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>>> Hi
    >>>>
    >>>> I have written a DLL that raise several events. I want to use this DLL
    >>>> and the associated events within Access 2003 but cannot seem to find
    >>>> the correct syntax of the WithEvents.
    >>>>
    >>>> In VB I would just dim the dll using the Withevents and then the events
    >>>> would appear in the procedure list which I could select and use.
    >>>>
    >>>> This is not the case in Access. Any ideas please.
    >>>>
    >>>> Chubbly
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  7. Chubbly Geezer

    Chubbly Geezer
    Expand Collapse
    Guest

    If I add a ref to Excel for example and declare an instance of that, it does
    indeed add entries to the procedures list.


    "Pieter Wijnen"
    <it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
    wrote in message news:OzTg6exqGHA.2256@TK2MSFTNGP03.phx.gbl...
    > have you added a reference to the dll?
    > open Module/tools/references
    >
    > Pieter
    >
    > "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    > news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    >> Well that's what I thought, but they don't.
    >>
    >> Could it be that I am using a .Net dll via a tlb file?
    >>
    >> My declaration is in the declarations section and looks fine
    >>
    >> Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >>
    >>
    >>
    >> "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    >> news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >>> If you declare an instance of a Class in Access VBA with the following
    >>> syntax:
    >>>
    >>> Dim WithEvents Something As clsMyClass
    >>>
    >>> in the declarations section of the relevant module, the Public Events of
    >>> the class definitely appear in the procedures list
    >>>
    >>> Does this help?
    >>>
    >>>
    >>> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >>> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>>> Hi
    >>>>
    >>>> I have written a DLL that raise several events. I want to use this DLL
    >>>> and the associated events within Access 2003 but cannot seem to find
    >>>> the correct syntax of the WithEvents.
    >>>>
    >>>> In VB I would just dim the dll using the Withevents and then the events
    >>>> would appear in the procedure list which I could select and use.
    >>>>
    >>>> This is not the case in Access. Any ideas please.
    >>>>
    >>>> Chubbly
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  8. Jon Lewis

    Jon Lewis
    Expand Collapse
    Guest

    You're right. It seems it won't work with tlb's, just Dll's & Ocx's. I
    don't know enough about tlb's to understand why although I noticed that if
    you browse to add a reference and pick a tlb Access actually sets the
    reference to an identically named dll if it exists.

    HTH
    "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    news:ORs5ulxqGHA.4864@TK2MSFTNGP03.phx.gbl...
    > Yep. Well a reference to the tlb file.
    >
    > "Pieter Wijnen"
    > <it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
    > wrote in message news:OzTg6exqGHA.2256@TK2MSFTNGP03.phx.gbl...
    >> have you added a reference to the dll?
    >> open Module/tools/references
    >>
    >> Pieter
    >>
    >> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >> news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    >>> Well that's what I thought, but they don't.
    >>>
    >>> Could it be that I am using a .Net dll via a tlb file?
    >>>
    >>> My declaration is in the declarations section and looks fine
    >>>
    >>> Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >>>
    >>>
    >>>
    >>> "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    >>> news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >>>> If you declare an instance of a Class in Access VBA with the following
    >>>> syntax:
    >>>>
    >>>> Dim WithEvents Something As clsMyClass
    >>>>
    >>>> in the declarations section of the relevant module, the Public Events
    >>>> of the class definitely appear in the procedures list
    >>>>
    >>>> Does this help?
    >>>>
    >>>>
    >>>> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >>>> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>>>> Hi
    >>>>>
    >>>>> I have written a DLL that raise several events. I want to use this
    >>>>> DLL and the associated events within Access 2003 but cannot seem to
    >>>>> find the correct syntax of the WithEvents.
    >>>>>
    >>>>> In VB I would just dim the dll using the Withevents and then the
    >>>>> events would appear in the procedure list which I could select and
    >>>>> use.
    >>>>>
    >>>>> This is not the case in Access. Any ideas please.
    >>>>>
    >>>>> Chubbly
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  9. Chubbly Geezer

    Chubbly Geezer
    Expand Collapse
    Guest

    So it seems that if I have a .Net dll, I'm stuffed.


    "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    news:OnmB5n0qGHA.3816@TK2MSFTNGP05.phx.gbl...
    > You're right. It seems it won't work with tlb's, just Dll's & Ocx's. I
    > don't know enough about tlb's to understand why although I noticed that if
    > you browse to add a reference and pick a tlb Access actually sets the
    > reference to an identically named dll if it exists.
    >
    > HTH
    > "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    > news:ORs5ulxqGHA.4864@TK2MSFTNGP03.phx.gbl...
    >> Yep. Well a reference to the tlb file.
    >>
    >> "Pieter Wijnen"
    >> <it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace.with.norway>
    >> wrote in message news:OzTg6exqGHA.2256@TK2MSFTNGP03.phx.gbl...
    >>> have you added a reference to the dll?
    >>> open Module/tools/references
    >>>
    >>> Pieter
    >>>
    >>> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >>> news:%23EeiabxqGHA.5008@TK2MSFTNGP05.phx.gbl...
    >>>> Well that's what I thought, but they don't.
    >>>>
    >>>> Could it be that I am using a .Net dll via a tlb file?
    >>>>
    >>>> My declaration is in the declarations section and looks fine
    >>>>
    >>>> Dim WithEvents WWinTI As WWinTiNET.clsCardAuthorisation
    >>>>
    >>>>
    >>>>
    >>>> "Jon Lewis" <jon.lewis@btinternet.com> wrote in message
    >>>> news:%23$U4ZUxqGHA.2464@TK2MSFTNGP03.phx.gbl...
    >>>>> If you declare an instance of a Class in Access VBA with the following
    >>>>> syntax:
    >>>>>
    >>>>> Dim WithEvents Something As clsMyClass
    >>>>>
    >>>>> in the declarations section of the relevant module, the Public Events
    >>>>> of the class definitely appear in the procedures list
    >>>>>
    >>>>> Does this help?
    >>>>>
    >>>>>
    >>>>> "Chubbly Geezer" <chubbly_geezer@newsgroup.nospam> wrote in message
    >>>>> news:u0kdw3wqGHA.2440@TK2MSFTNGP03.phx.gbl...
    >>>>>> Hi
    >>>>>>
    >>>>>> I have written a DLL that raise several events. I want to use this
    >>>>>> DLL and the associated events within Access 2003 but cannot seem to
    >>>>>> find the correct syntax of the WithEvents.
    >>>>>>
    >>>>>> In VB I would just dim the dll using the Withevents and then the
    >>>>>> events would appear in the procedure list which I could select and
    >>>>>> use.
    >>>>>>
    >>>>>> This is not the case in Access. Any ideas please.
    >>>>>>
    >>>>>> Chubbly
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page