How to view relationship window using Access VBA?

Posted on 2011-10-22
Last Modified: 2013-11-28
Per the following image - how may I force the Relationship window screen appear for someone by clicking a button using VBA coding only?
Question by:stephenlecomptejr
    LVL 61

    Accepted Solution

    Try this in your button's Click Event:

    DoCmd.RunCommand acCmdRelationships
    LVL 74

    Assisted Solution

    by:Jeffrey Coachman
    <No points wanted>
    Note that there is no easy way to make the relationship window "Read Only"
    So any user opening this screen will have full access to do whatever they want (either intentionally or by accident)
    So you might want to somehow restrict access to this screen to only a developers (or other high level users)

    FWIW you can also do this (after you run mbizup's code) to open a Report of the relationships.
        DoCmd.RunCommand acCmdPrintRelationships


    LVL 75

    Assisted Solution

    by:DatabaseMX (Joe Anderson - Access MVP)
    As far as printing the Relationships window, there are a couple of other ways:
    Scroll to the bottom to "Vizual Relations
    The smart way to print Access relationships! Vizual Relations 97 or Vizual Relations 2000/2002."
    This does a MUCH better job of printing relationships.  I have this AddIn.

    And this is cool also:

    LVL 1

    Author Closing Comment

    LVL 61

    Expert Comment

    Glad to help out :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    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…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    761 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

    10 Experts available now in Live!

    Get 1:1 Help Now