As you seem to be making heavy weather of creating a set of related tables, if what you need is a way to see the source to which a table was linked when you come to configure your new system, why not just create a single table with columns for the database
name, table name and its Connect string. That will give you the information you need, and it would need no data entry at all as the rows can easily be inserted for each Access database with a little bit of fairly simple code. In fact I've quickly put together
a little file containing .accdb and .mdb which does this, as TablelinksInfo.zip in my public databases folder at:
https://skydrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
You might have to copy the text of the link into your browser's address bar (not the link location). For some reason it doesn't always seem to work as a hyperlink.
The file uses the following module to create an d populate the table:
Option Compare Database
Option Explicit
Public Function FillTablelinks(strDatabase As String)
On Error GoTo Err_Handler
Dim dbsExtCurrent As DAO.Database
Dim dbsExt As DAO.Database
Dim tdf As DAO.TableDef
Dim strSQL As String
Set dbsExtCurrent = CurrentDb
Set dbsExt = OpenDatabase(strDatabase)
For Each tdf In dbsExt.TableDefs
If tdf.Connect <> "" Then
strSQL = _
"INSERT INTO TableLinks(DatabaseName,TableName,ConnectString) " & _
"VALUES(""" & dbsExt.Name & """,""" & tdf.Name & """,""" & tdf.Connect & """)"
dbsExtCurrent.Execute strSQL, dbFailOnError
End If
Next tdf
MsgBox "Operation Completed.", vbInformation, "Confirmation"
Exit_Here:
Exit Function
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error"
Resume Exit_Here
End Function
Public Function CreateTable() As Boolean
Const TABLEEXISTS = 3010
Dim tdf As DAO.TableDef
Dim strSQL As String
strSQL = _
"CREATE TABLE TableLinks (" & _
"DatabaseName TEXT(255)," & _
"TableName TEXT(255)," & _
"ConnectString TEXT(255)," & _
"CONSTRAINT PrimaryKey PRIMARY KEY (DatabaseName, TableName))"
On Error Resume Next
CurrentDb.Execute strSQL, dbFailOnError
Select Case Err.Number
Case 0
' no error
CreateTable = True
Application.RefreshDatabaseWindow
Case TABLEEXISTS
' anticipated error
CreateTable = True
Case Else
' unknown error
CreateTable = False
MsgBox Err.Description, vbExclamation, "Error"
End Select
End Function
All you need to do is select the Access file by clicking the top button on the opening form to open the common dialogue, then click the Insert Rows etc. button. The other buttons open a form and report to view the inserted data, the form also including a combo
box to find a table by name.