Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Unanswered: forced referencing

    okay i've just notice a really iritataing problem, i'm working in access XP
    the people running the software have access 2000

    now my computer uses the object libraries in:
    C:\program file\microsoft office\office10\
    but the libraries for the users are in
    C:\program file\microsoft office\office\
    meaning that they get undefinded user type error on software that works perfectly for me.

    is there a way of bypassing the references menu and defining manualy the location of a libraries ie
    after i have the DB working let me set the drivers to the C:\program file\microsoft office\office\ version than doesn't excist for me
    Last edited by m.timoney; 05-13-03 at 13:14.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  2. #2
    Join Date
    Mar 2003
    Posts
    46
    Hi there,

    I posted this a few days ago, thought this might be what you're looking for...



    I use the following to Add/Remove references:

    Function AddReference() As Boolean
    Dim ref As Reference, strFile As String

    On Error GoTo Error_AddReference
    strFile = "C:\Program Files\blp\api\activex\blpdatax.dll" 'Data Type Library filepath
    Set ref = References.AddFromFile(strFile)
    AddReference = True

    Exit_AddReference:
    Exit Function

    Error_AddReference:
    MsgBox Err & ": " & Err.Description
    AddReference = False
    Resume Exit_AddReference
    End Function

    Function RemoveReference() As Boolean

    Dim ref As Reference

    On Error GoTo Error_RemoveReference
    Set ref = References!BLP_DATA_CTRLLib 'Data Type Library name
    References.Remove ref
    RemoveReference = True

    Exit_RemoveReference:
    Exit Function

    Error_RemoveReference:
    MsgBox Err & ": " & Err.Description
    RemoveReference = False
    Resume Exit_RemoveReference
    End Function

    Change "C:\Program Files\blp\api\activex\blpdatax.dll" to whatever filepath your Data Type Library has and change "References!BLP_DATA_CTRLLib" to your specific Data Type Library name

    Hope it helps

    C

  3. #3
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    so if i add

    Dim ref As Reference
    on error goto a
    Set ref = References.AddFromFile("C:\program file\microsoft office\office10\MSOUTL.OLB")
    AddReference = True
    b:on error goto 0


    ...

    exit sub
    a:
    Set ref = References.AddFromFile("C:\program file\microsoft office\office\MSOUTL.OLB")
    AddReference = True
    goto b

    to the startup form it should work
    is removing the refference required?
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  4. #4
    Join Date
    Mar 2003
    Posts
    46
    If you have the reference set and then try to set it again you will get an error message (can't remember the wording or number right now...) - not sure if your error trapping catches that, I think it probably does, in which case you won't need to remove the reference.

    C

Posting Permissions

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