Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    7

    Add reference in MS-Access Problem.

    Hi,

    I have created a MS-Access based tool and I am adding below mentioned references at a form load event, it is working fine at my workstation but when I am running this tool in other system it is not working properly because like at my system calendar control version 10 and on that system have version 8, Excel object library 12 and on that system have version 11.

    I want that whenever I open the form it will automatically add most latest version in reference. Of below mentioned references.

    VBA
    Access
    stdole
    ADODB
    OWC10
    Excel
    DAO
    Office
    MSOWCFLib
    MSACAL

    Sub AddRefs()
    Dim loRef As Access.Reference
    Dim guid1 As String
    Dim guid2 As String
    Dim guid3 As String
    Dim guid4 As String
    Dim guid5 As String
    Dim guid6 As String
    Dim guid7 As String
    Dim guid8 As String
    Dim guid9 As String
    Dim guid10 As String

    guid1 = "{000204EF-0000-0000-C000-000000000046}"
    guid2 = "{4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}"
    guid3 = "{00020430-0000-0000-C000-000000000046}"
    guid4 = "{00000205-0000-0010-8000-00AA006D2EA4}"
    guid5 = "{0002E550-0000-0000-C000-000000000046}"
    guid6 = "{00020813-0000-0000-C000-000000000046}"
    guid7 = "{00025E01-0000-0000-C000-000000000046}"
    guid8 = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"
    guid9 = "{5D0A2606-5783-11D1-B901-00AA00585640}"
    guid10 = "{8E27C92E-1264-101C-8A2F-040224009C02}"

    On Error Resume Next



    With Access.References
    .AddFromGuid guid1, 1, 0
    .AddFromGuid guid2, 1, 0
    .AddFromGuid guid3, 1, 0
    .AddFromGuid guid4, 1, 0
    .AddFromGuid guid5, 1, 0
    .AddFromGuid guid6, 1, 0
    .AddFromGuid guid7, 1, 0
    .AddFromGuid guid8, 1, 0
    .AddFromGuid guid9, 1, 0
    .AddFromGuid guid10, 1, 0

    End With

    ' Call a hidden SysCmd to automatically compile/save all modules.
    Call SysCmd(504, 16483)
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I guess you wil have to include conditional If Then Else structure. Code will have to detect app version. Then the conditional structure will run the correct set depending on the detected version.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Add reference in MS-Access
    By kashif.special2005 in forum Access
    Replies: 1
    Last Post: 03-12-2012, 10:19 PM
  2. Access Reference
    By joekuhn in forum Access
    Replies: 2
    Last Post: 06-17-2011, 08:38 PM
  3. form/subform reference problem
    By dbertanjoli in forum Forms
    Replies: 1
    Last Post: 01-10-2011, 03:31 PM
  4. Fixing Reference problem
    By Alex Motilal in forum Access
    Replies: 6
    Last Post: 12-30-2010, 02:12 AM
  5. Reference Problem
    By ksmithson in forum Forms
    Replies: 9
    Last Post: 07-15-2010, 01:22 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