Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding References in Access with VBA (Access 2000)

    I've built an application in Access for which I had to add references to the common dialog tool, for example. The application works fine on my pc, but the mde that I distributed does not work on other pc's that have not had the missing reference added. Is there a way to add some code to the login form, for example that will add the necessary references? Do I need to create a library database with the needed references set first?

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

    Re: Adding References in Access with VBA (Access 2000)

    Are you talking about the common dialog control? In Access I always use the API calls instead, and that doesn't require registering anything. If you are talking about the control, it won't be enough to set a reference, you have to make sure the control is there and registered.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding References in Access with VBA (Access 2000)

    Thank you very much for your reply. Yes, I was referring to the common dialog control. I also have references set to the ds ole document properties object library, microsoft outlook, as well as microsoft scripting runtime. Would you use API calls in all of these instances? If so, is there some code sample you might be able to direct me to? The application is meant to run only here where I work so there shouldn't be any problem with the controls I've included not being on everyone's pc, but I'm not sure what would need to be done to make sure that they're registered. Any help you can offer would be much appreciated.

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

    Re: Adding References in Access with VBA (Access 2000)

    References to libraries shouldn't be a problem as long as the libraries are installed on the other machines. ActiveX controls are a different proposition since they may not be available on the other PCs. There is code for launching the Windows fileopen dialog here. I know that <!profile=HansV>HansV<!/profile> has posted his own code module and class for handling it several times, but unfortunately the Mods don't have any more access to the Lounge's absent search features than anyone else, so I can't locate his latest post. Perhaps he'll jump in and point you to it.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Oct 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding References in Access with VBA (Access 2000)

    Did I mention that the application runs as an mde? I don't seem to be able to compile the mde now that I've set a reference to a library database. I may need to come up with another way to distribute this application. Anyway, thanks very much for trying to help me!

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

    Re: Adding References in Access with VBA (Access 2000)

    No, you had neglected to mention that and it makes a big difference since MDE do not allow design changes are runtime. If you make a change, it has to be made to the MDB and a new MDE created. There is no way to compile an MDE or to set references in it once it has been compiled. If you have the Office Developers edition, you can package the database, including activex controls and distribute the setup to your other machines. That will make certain the necessary controls are in place and registered.
    Charlotte

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding References in Access with VBA (Access 2000)

    I can't locate it either, so I'll attach the demo again, for what it's worth. Probably won't help in this case.

    For whoever wants to use it:

    The zipped Access 97 database contains a class module and a standard module; copy both to your own database. The database also contains a sample form; the code behind it is an example of how to use the class module.
    Attached Files Attached Files

Posting Permissions

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