Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    Can References be created by VBA Code?

    If so, what are the commands to select the following references automatically?:

    Visual Basic for Applications
    Microsoft Access 9.0 Object Library
    OLE Automation
    Microsoft DAO 3.6 Object Library
    Microsoft Visual Basic for Applications Extensibility 5.3
    Microsoft Office 9.0 Object Library
    Microsoft Windows Common Controls 5.0 (SP2)
    C:WindowsSystemCOMCTL32.OCX


    Thanks, John Graves

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    What exactly are you trying to do? The first three references you listed are created automatically when you create a new database. The rest have to be set specifically, but you would also have to unselect the ADO reference. An additional problem is that the locations of those libraries vary depending on the operating system and the specific way that Office was installed (i.e., multiple versions on the same machine).

    In any case, open on-line help and type "reference object" (no quotes) in the answer wizard textbox to return a list of related help topics, including examples of code.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    Are the DOA and ADO references mutually exclusive? I thought it was possible to have both "checked" in same database?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    They're not mutually exclusive, but in a converted database, the odds are that the references will not be object model specific, so the choices are either to uncheck the ADO references or to go through the code and add DAO to each reference as appropriate. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    Hi Charlotte

    Thanks for your help.

    I found this which may be of interest to you and others.

    John Graves

    How can I save and restore the list of references ?

    <A target="_blank" HREF=http://www.unsoftwareag.com/PUP_UML_OK.asp?PowerupName=NOPE&Faq=TRUE>http://www.unsoftwareag.com/PUP_UML_OK.asp...PE&Faq=TRUE</A>

    Edited at activate link--Charlotte

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Select References with VBA Code? (Using A2k (9.0.4402) SR-1)

    >>but in a converted database, the odds are that the
    references will not be object model specific<<

    Yes, in this situation you are absolutely right; it is better to uncheck the ADO reference. Saves alot of trouble! (been there, missed a declaration or two!)
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •