Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2008, 08:58 PM
Authorized User
 
Join Date: Mar 2008
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default displaying relationships

I tried creating a means for a user to look at the database relationships using

Private Sub cmdShowRelationships_Click()
DoCmd.RunCommand acCmdShowAllRelationships
End Sub

I get runtime error 2046: "The command or action ShowAllRelationships isn't available now."

I'd appreciate tips on how to make it possible to open relationships from a command button.

 
Old August 14th, 2008, 10:20 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Relationship menu commands only work when in the relationships window so you have to open that first if it isn't:
---------------------------------------------------
  DoCmd.RunCommand acCmdRelationships
  DoCmd.RunCommand acCmdShowAllRelationships
---------------------------------------------------

Hopefully this will eliminate the error.
-AL






Similar Threads
Thread Thread Starter Forum Replies Last Post
1 to 1 relationships scandalous Access 13 January 31st, 2007 12:07 PM
Many-to-Many Relationships in O/R Mapping sarosh Classic ASP Databases 0 December 8th, 2006 05:45 AM
relationships - why really? pettrer SQL Server ASP 2 August 31st, 2006 12:59 PM
Table relationships tanjuakio SQL Server 2000 3 July 28th, 2005 09:14 AM
How to deal with relationships? drarem Access 3 July 7th, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.