Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    23

    Unanswered: Reference to DAO 6

    Is there any way to refer to DAO 6 in the object library on opening the form without manually going to to tools-reference-dao 6 and clicking on it ?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    look in the code bank... there is an example of programmaticaly enforcing references
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I've not done that specific job, but I have modified references to outlook using vba.

    Here's a little VBA function that I used to play around with the Outlook reference. It removes the existing outlook reference and adds a reference to the file:

    Code:
    Sub ReferencesCorrection()
        'not sure this can be done in an MDE.
        Dim vReference As Reference
        Dim vOutputString As String
        
        'Find the outlook reference and remove it.
        For Each vReference In References
            If vReference.Name = "Outlook" Then References.Remove vReference
        Next
        
        'iterate through references and store in a variable for display
        For Each vReference In References
            'remove a reference if it's outlook.
            vOutputString = vOutputString & vReference.Name & " - Path:" & vReference.FullPath & vbNewLine
        Next
        
        'show current references.
        MsgBox vOutputString
        
        'add a reference -- this seems to add a reference to C:\Program Files\etc, not M: ??
        References.AddFromFile "M:\MMData\MSOUTL.OLB"
        
        'add a couple of lines.
        vOutputString = vOutputString & vbNewLine & vbNewLine
        
        'loop through the references again
        For Each vReference In References
          vOutputString = vOutputString & vReference.Name & " - Path:" & vReference.FullPath & vbNewLine
        Next
        
        'show the results
        MsgBox vOutputString
    End Sub
    It might at least point you in the right direction.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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