[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to view relationship window using Access VBA?

Posted on 2011-10-22
Medium Priority
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

mbizup earned 1600 total points
ID: 37011010
Try this in your button's Click Event:

DoCmd.RunCommand acCmdRelationships
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 200 total points
ID: 37011282
<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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 200 total points
ID: 37011669
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:


Author Closing Comment

ID: 37015391
LVL 61

Expert Comment

ID: 37015439
Glad to help out :-)

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

872 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