View Single Post
  #4  
Old January 12th, 2010, 12:59 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default can't change the data type or field size

On Mon, 11 Jan 2010 13:41:02 -0800, Steve Stad
wrote:

John - Thanks for quick reply. I tried this code in the immediate window.
...to 'call
this code from the Immediate window'?? do I compile??...step into??...run
macro??? sorry i am a newbie particualy w/code. What should I expect to
see? I opened the imediate window from blank form/design mode.


Sorry! Too brief there on my part.

Open the database. Find the Modules tab and create a new module. Copy and
paste


PUblic Sub ShowAllRelations()
Dim db As DAO.Database
Dim rel As Relation
Dim fld As Field
Set db = MasterDB
For Each rel In db.Relations
Debug.Print "Relation "; rel.Name, rel.Table, rel.ForeignTable
For Each fld In rel.Fields
Debug.Print fld.Name; " linked to "; fld.ForeignName
Next fld
Next rel
End Sub

into a new Module. Click Debug.Compile from the Menu; post back if you get any
errors.

Save the module using some name OTHER than ShowAllRelations - basRelations
maybe.

Then type Ctrl-G if the immediate window isn't visible. When it is, type

Call ShowAllRelations

into the immediate window.

You should see a scrollable list of all your table relationships.
--

John W. Vinson [MVP]