Check for a reference

Posted on 2011-05-04
Last Modified: 2012-05-11
I have an Access Project that writes to MS Project.  We used it on Citrix, which was fine.  NOw, the have the database running from some local machines, and those machines use other features that don't have Project.   The user gets the attached message  and it kicks them out of the run-time version.  They never can even open the app.

I obviously can't turn off the Reference in VB or the code erros when it creates the object.

How can I dynamically have this work based on if Project is installed???
Question by:sharpapproach
    LVL 12

    Expert Comment

    Check this thread out about References and how to deal with it;

    LVL 75

    Accepted Solution

    I would look up CreateObject in VBA Help, and use late binding, eliminating the need for setting a Reference to Project.

    There is an example showing how to do this for Excel in the Help file.  Project would be the same.

    LVL 26

    Expert Comment

    Late binding would work as @mx says
    You'd also have to work out which parts of the db use the Project code and build some logic that detects if Project is not installed, then stuff hides, disappears or exits nicely.
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    thx for agreeing with me (again) Nick :-)


    Author Closing Comment

    worked perfect!  Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now