Advertisement

08.06.2007 at 07:38AM PDT, ID: 22744179
[x]
Attachment Details

Creating reference through code

Asked by sf_garrison in Access Coding/Macros, Microsoft Access Database, Visual Basic Programming

Tags: Microsoft, Access, 2007, VBA; Adding references, VBA

I need to find code that will create a reference to another Access DB which contains generic code used throughout several other company applications.  All of our user's applications are shared in a drive created specifically for them.  Here is an idea of what I am trying to use, but it doesn't seem to work on a properly.    (This code is called with an AutoExec Macro):
(Also, just a note, the DIOS database contains the SetUpMenu Function)
Public Function SalesAppStartUp()
On Error GoTo Err_Handler

Dim ref As Reference
Dim strDBPath As String
Dim strUser As String
    strDBPath = "\\genesys08\users\" & fOSUserName & "\databases\DIOS.accdb"
MsgBox strDBPath
'CHECK FOR MISSING REFERENCES, IF MISSING REMOVE REFERENCE
    For Each ref In References
        If ref.IsBroken Then
            References.Remove ref
            MsgBox "A Missing reference has been detected and removed", vbOKOnly
        End If
    Next ref

'ADD DIOS REFERENCE IF IT DOESN'T EXIST
AddRef:
    For Each ref In References
        If ref.NAME = "DIOS" Then
            GoTo MenuSetup
        End If
    Next
    References.AddFromFile (strDBPath)

'SET UP MAIN DATABASE MENUS USING FUNCTION IN DIOS
MenuSetup:
    SetupMenu
    GoTo Exit_Function
Exit_Function:
    Set ref = Nothing
    Exit Function
Err_Handler:
    If Err.Number = 29060 Then
        MsgBox strDBPath & " was not found.  Please Notify Systems Dept."
        Resume Exit_Function
    End If
    MsgBox Err & ": " & Err.Description
    Resume Exit_Function
End FunctionStart Free Trial
[+][-]08.06.2007 at 08:23AM PDT, ID: 19638968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 08:37AM PDT, ID: 19639067

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 09:16AM PDT, ID: 19639333

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 09:39AM PDT, ID: 19639495

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 09:51AM PDT, ID: 19639585

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 10:01AM PDT, ID: 19639667

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2007 at 06:07PM PDT, ID: 19642670

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2007 at 01:07PM PDT, ID: 19649261

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2007 at 01:37PM PDT, ID: 19649497

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.07.2007 at 02:02PM PDT, ID: 19649671

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, Visual Basic Programming
Tags: Microsoft, Access, 2007, VBA; Adding references, VBA
Sign Up Now!
Solution Provided By: aesmike
Participating Experts: 3
Solution Grade: A
 
 
[+][-]08.08.2007 at 11:42AM PDT, ID: 19656835

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.08.2007 at 11:52AM PDT, ID: 19656902

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.08.2007 at 11:55AM PDT, ID: 19656925

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.08.2007 at 11:58AM PDT, ID: 19656952

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.08.2007 at 01:18PM PDT, ID: 19657651

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.08.2007 at 01:24PM PDT, ID: 19657700

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628