Results 1 to 10 of 10
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Removing a VBA reference before front end loads


    Is there a way to script in the removal of a Reference (this one is "Outlook") as some of the users I have use Runtime Access which doesn't contain that particular library.

    I'd like it to load the first form without an error and being able to move the reference before it all loads would be nice.

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    As you can see I want to avoid this on startup

    Click image for larger version. 

Name:	Capture.JPG 
Views:	25 
Size:	83.7 KB 
ID:	17944

  3. #3
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Just switch to Late Binding...
    http://www.granite.ab.ca/access/latebinding.htm
    For examples…
    http://word.mvps.org/FAQs/InterDev/E...ateBinding.htm

    Now, you may have to also include code to check for Outlook or when your database does *look* for it you will still get an error.

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by GinaWhipp View Post
    Just switch to Late Binding...
    http://www.granite.ab.ca/access/latebinding.htm
    For examples…
    http://word.mvps.org/FAQs/InterDev/E...ateBinding.htm

    Now, you may have to also include code to check for Outlook or when your database does *look* for it you will still get an error.
    I already use late binding - however sometimes I forget to disable the library when working on it so it's pre-loaded when I send it to staff.

    The only other thing I can think of is a command when you close the front end itself - have an on close action (not an on close action on a form, I mean the application itself).

  5. #5
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Not sure I understand because using Late Binding it should never preload nor should you have to check it for testing. Why are you checking it?

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by GinaWhipp View Post
    Not sure I understand because using Late Binding it should never preload nor should you have to check it for testing. Why are you checking it?
    If you add a library whether through VBA or going through the editor and then save the project - the next time you open it it will have saved it with the library.

    This is a problem if I forget to remove it.

  7. #7
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    I have never had that problem using Late Binding. It should only bind at the time of use that is the reason for using it. Could it be that you are *closing out* the routine and that is why it is remaining? Perhaps you should post that section of code here.

  8. #8
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Are you suggesting I remove it each time the code is going to execute? I could place code to remove it each time it has finished - I load it when the first basic form loads not when the task is needed because there are several points it gets done (adds more work)

  9. #9
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    No, what I am saying is...

    Using Microsoft Outlook 14.0 Object Library

    Using Late Binding you should never have to check it. When you call your Function runs it will add it temporarily and then once it's finished it will be unchecked. This is all handled in the background. If that is not happening then something in your code or Function is not *releasing* it and it is remaining checked. That is why I asked to see the code/Function.

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    My experience with early binding Office references is that it will work across different versions. Access is smart enough to look for the other version of Outlook, Excel, Word, and Office Objects references.

    The issue with referencing an Office object is when doing so where Office is not installed on the client machine. If there is not any version available, that is when the missing reference issue arises.

    To avoid this possibility of an error, use late binding and error trapping. I am not aware of any other possible approach. There certainly may be a way of programmatically adjusting the references. However, I doubt that any such adjustments would be possible during Runtime. These adjustments to references will, most likely require Design Time and not be available via the Run Time engine exclusively.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form loads with no current record
    By ts_hunter in forum Forms
    Replies: 11
    Last Post: 01-15-2014, 10:33 AM
  2. Form loads blank
    By sweetiepie in forum Forms
    Replies: 5
    Last Post: 06-07-2012, 02:34 PM
  3. Front end reference problem
    By lrobbo314 in forum Access
    Replies: 1
    Last Post: 04-23-2012, 06:08 PM
  4. Table loads too slowly
    By pcbrush in forum Access
    Replies: 8
    Last Post: 11-24-2010, 06:35 PM
  5. list box not updating until form loads
    By cowboy in forum Forms
    Replies: 3
    Last Post: 03-12-2010, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums