473,659 Members | 2,920 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Releationship diagram goes haywire

I have added some tables to the MS Access relationship diagram window
(2003) and added some relationships. But after a while when I reopen
the diagram some of the tables are hidden above the top of thewindow
(the relationship lines appear to go way up beyond the upper scroll
limit.

How can I sort them out with out redoing thediagram?

Aug 27 '06 #1
3 4788
On 27 Aug 2006 11:16:49 -0700, "Terry" <te*********@oe l.eclipse.co.uk >
wrote:

You can't, unless you really want to dive into several undocumented
msys* tables.
Better to delete the tables from the diagram, and then select
Relationships All

-Tom.
>I have added some tables to the MS Access relationship diagram window
(2003) and added some relationships. But after a while when I reopen
the diagram some of the tables are hidden above the top of thewindow
(the relationship lines appear to go way up beyond the upper scroll
limit.

How can I sort them out with out redoing thediagram?
Aug 28 '06 #2
"Tom van Stiphout" <no************ *@cox.netwrote in message
news:lb******** *************** *********@4ax.c om...
On 27 Aug 2006 11:16:49 -0700, "Terry" <te*********@oe l.eclipse.co.uk >
wrote:

You can't, unless you really want to dive into several undocumented
msys* tables.
Better to delete the tables from the diagram, and then select
Relationships All

-Tom.
>>I have added some tables to the MS Access relationship diagram window
(2003) and added some relationships. But after a while when I reopen
the diagram some of the tables are hidden above the top of thewindow
(the relationship lines appear to go way up beyond the upper scroll
limit.

How can I sort them out with out redoing thediagram?

Hi Tom,
if the Relationship Diagram is too complex or too time consuming to recreate
then you can programmaticall y loop through all of the individual windows in
the Relationship window fixing any negative window cordinates you find.
Below is code that only checks and modifies windows off of the left edge of
the screen but it could be easilty modified to check for Vertical negative
coordinates as well.
From: Stephen Lebans - view profile
Date: Tues, Nov 26 2002 6:03 pm
Email: "Stephen Lebans" <StephenLeb...@ mvps.org>
Groups: comp.databases. ms-access
Not yet ratedRating:
show options
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse | Find messages by this author
If for some reason you had a number of relationships that would be
difficult/time consuming to recreate then here is a code fix for this
issue. If you have trouble implementing this code, it is contained
within a Form in the Utilities MDB on my site. Just import the Form into
your app, open the Form and click on the appropriate Command Button.
http://www.lebans.com/utilities.htm

Place the following code behind a Form containing two CommandButton
controls named:
cmdFix
cmdCloseWindow
'DEVELOPED AND TESTED UNDER MICROSOFT ACCESS 97 VBA
'
'Copyright: Stephen Lebans - Lebans Holdings 1999 Ltd.
' Please feel free to use this code within your own projects,
' both private and commercial, with no obligation.
' You may not resell this code by itself or as part of a
collection.
'
'
'Name: None
'
'Version: 1.0
'
'Purpose: 1) To close the Debug Window via code.
' 2) To fix any items in the RelationShips window that are off
screen
'
'Author: Stephen Lebans
'
'Email: Step...@lebans. com
'
'Web Site: www.lebans.com
'
'Date: July 02 , 2002, 11:11:11 PM
'
'Credits: Your for the taking!<grin>
'
'BUGS: Please report any bugs to:
' Step...@lebans. com
'
'What's Missing:
' Nothing!
'
'How it Works:
' Walk through the source code!<grin>
'
' Enjoy
' Stephen Lebans
Option Compare Database
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindow A" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias _
"FindWindow ExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function apiGetWindow Lib "user32" _
Alias "GetWindow" _
(ByVal hWnd As Long, _
ByVal wCmd As Long) _
As Long
Private Declare Function apiGetClassName Lib "user32" _
Alias "GetClassNa meA" _
(ByVal hWnd As Long, _
ByVal lpClassName As String, _
ByVal nMaxCount As Long) _
As Long
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function PostMessage Lib "user32" Alias _
"PostMessag eA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _
ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As
Long) As Long
Private Const SWP_NOSIZE = &H1
Private Const WM_CLOSE = &H10
' GetWindow() Constants
Private Const GW_HWNDFIRST = 0
Private Const GW_HWNDLAST = 1
Private Const GW_HWNDNEXT = 2
Private Const GW_HWNDPREV = 3
Private Const GW_OWNER = 4
Private Const GW_CHILD = 5
Private Const GW_MAX = 5
Private Sub cmdCloseWindow_ Click()
' Close the Debug Window via code
On Error GoTo Err_cmdCloseWin dow_Click
Dim lngRet As Long
Dim hWndMDI As Long
Dim hWndDebug As Long
' If this instance of Access has set the
' Debug Window to "Always on Top" via the menu:
' Tools->Options->Module
' then the Debug WIndow is a top level window.
hWndDebug = FindWindow(vbNu llString, "Debug Window")
If hWndDebug <0 Then
lngRet = PostMessage(hWn dDebug, WM_CLOSE, 0&, 0&)
Exit Sub
End If
' The Debug Window is a child of the MDI window
' find MDIClient first
hWndMDI = FindWindowEx(Ap plication.hWndA ccessApp, 0&, "MDIClient" ,
vbNullString)
' Find the Debug Window
hWndDebug = FindWindowEx(hW ndMDI, 0&, "OImmediate ", "Debug Window")
If hWndDebug <0 Then
lngRet = PostMessage(hWn dDebug, WM_CLOSE, 0&, 0&)
Else
MsgBox "The Debug Window is not open."
End If
Exit_cmdCloseWi ndow_Click:
Exit Sub
Err_cmdCloseWin dow_Click:
MsgBox Err.Description
Resume Exit_cmdCloseWi ndow_Click
End Sub
Private Sub cmdFix_Click()
' Fix any windows that are off the Left edge of the RelationShips window
On Error GoTo Err_cmdFix_Clic k
Dim lngRet As Long
Dim hWndMDI As Long
Dim hWndRel As Long
Dim hWndODsk As Long
Dim hWndTemp
Dim rc As RECT
' Force the RelationShips window to open
DoCmd.RunComman d acCmdRelationsh ips
' The window must be maximized
DoCmd.Maximize
DoEvents
' The Relationships Window is a child of the MDI Client window
' find MDIClient first.
hWndMDI = FindWindowEx(Ap plication.hWndA ccessApp, 0&, "MDIClient" ,
vbNullString)
' Find the Relationships Window
hWndRel = FindWindowEx(hW ndMDI, 0&, "OSysRel", "Relationships" )
If hWndRel = 0 Then
MsgBox "The Relationships Window is not open.", vbCritical,
"Critical Error"
Exit Sub
End If
' The first child window is of class ODsk
hWndODsk = FindWindowEx(hW ndRel, 0&, "ODsk", vbNullString)
' Loop through all of this level's Windows.
' We are looking for any windows with a negative
' Left value in it's Window Rectangle
' Let's get first Child Window of the ODsk window
hWndTemp = apiGetWindow(hW ndODsk, GW_CHILD)
If hWndTemp = 0 Then
MsgBox "Their are no Relationships!" , vbCritical, "Critical Error"
Exit Sub
Else
lngRet = GetWindowRect(h WndTemp, rc)
If rc.Left < 1 Then
rc.Left = 1
lngRet = SetWindowPos(hW ndTemp, 0&, rc.Left, rc.Top, 0&, 0&,
SWP_NOSIZE)
End If
End If
' Let's walk through every sibling window
Do
' Let's get the NEXT SIBLING Window
hWndTemp = apiGetWindow(hW ndTemp, GW_HWNDNEXT)
If hWndTemp <0 Then
lngRet = GetWindowRect(h WndTemp, rc)
If rc.Left < 1 Then
rc.Left = 1
lngRet = SetWindowPos(hW ndTemp, 0&, rc.Left, rc.Top, 0&,
0&, SWP_NOSIZE)
End If
End If
' Let's Start the process from the Top again.
' End this loop if no more Windows.
Loop While hWndTemp <0
' All done
Exit_cmdFix_Cli ck:
Exit Sub
Err_cmdFix_Clic k:
MsgBox Err.Description
Resume Exit_cmdFix_Cli ck
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

Aug 28 '06 #3
That worked!
Brilliant!
Many thanks Stephen

Terry

Aug 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2444
by: Rithish | last post by:
Hi folks. A premature and redundant question maybe... But I have a TABLE problem. This is almost something like what I want to acheive. ----------------------------------------- | | | | | | Col1 | Col2 | Col3 | Col4 |
1
4225
by: Maria | last post by:
Heya, I am doing some background reading about the database and i am a little bit confused, i would appreciated any help.... Assume been asked to draw the ER diagram for the following statement: "Many players play for a team but a player can play just in one team"
2
3313
by: Mihir | last post by:
all.. this group is amazing.. have been getting lot of answers without asking from this forum.. got a couple of questions.. first the background i am working on a database that has the network information and all the data that goes on it with the switches, the hardware, the software messages that go on it.. the links between networks.. i have all that
4
1854
by: PIEBALD | last post by:
I'm trying to find a general definition/specification for railroad diagrams. All I find online are explanations by authors who explain what _their_ particular format uses, but they leave me wondering if they are using only a subset of the possible structures. And there are a few that seem to use rather unique structures. Is there a standard? Does each author create his own? There must be a set of dos and don'ts somewhere!
2
51979
by: sangu_rao | last post by:
Hi, I have to prepare an ER diagram for the objects in my SQL Server database. I have used the option "DIAGRAMS" in EnterPrise Manager of SQL Server 2000. It is creating the diagram for the selected tables (but the diagram contains only the table which i have selected. It is not displaying its depended tables). But i am not able to export it to any of the flat file like MS WORD or paint. I want this diagram to be uploaded to one Flat file...
70
4310
by: Anson.Stuggart | last post by:
I'm designing a debounce filter using Finite State Machine. The FSM behavior is it follows the inital input bit and thinks that's real output until it receives 3 consecutive same bits and it changes output to that 3 consecutive bit until next 3 consecutive bits are received. A reset will set the FSM to output 1s until it receives the correct input and ouput. This is the test sequence with input and correct output. 1 0 0 1 0 1 0 0 0 1...
1
4680
by: Jennifer Jazz | last post by:
My question is regarding the mapping of Class diagram to the C++ coding. There are 3 realtions in Class diagram 1) Assosication 2) Composition 3) Aggregation (Weak Composition). -----------------------------------------------------
13
1909
by: Doug | last post by:
Hi all, A workmate was recently bitching to me about an RFC. (Apologies - the RFC number eludes me at present (it's related to the DIAMETER protocol, that's all I can remember) but I will try to find out and update the thread.) He was moaning how the RFC laid out the description of an 8-bit field. According to him, the diagram was (fixed-width font required,
0
2129
by: viepia | last post by:
Hi, My project writes records to a new SQL Server 2005 database with currently 18 tables. When I change the Database Diagram for my database I save the copy the list of changed tables to a notepad text file; then one at a time I delete the changed tables from my DBML Diagram and drag a replacement from the Server Explorer Table list. Is there a better way to keep the Database Diagram and DBML Diagram in sync? I would rather not...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.