I think we may be talking about different things. It's one thing to open another database using vba and do something in that database or with a procedure in that database.
I have a routines where I have a list of databases, and go out to each to get things like linked tables or tables/fields or modules/procs.
Here's part of one (opens many other databases in a loop)
Code:
'---------------------------------------------------------------------------------------
' Procedure : Multi_MDBs
' Author : user
' Date : 3/30/2008
' Purpose : Used to identify linked tables in a list of databases.
'---------------------------------------------------------------------------------------
'
Sub Multi_MDBs()
Dim ThisDB As DAO.Database
Dim otherDB As DAO.Database
Dim strDbPath As String
Dim RS As Recordset
Dim rz As Recordset
Dim tdf As TableDefs
Dim i As Integer
Dim MyBEPath As String
Dim strMsg As String
Dim sResponse As Variant
On Error GoTo Multi_MDBs_Error
On Error Resume Next
Dim tbl As TableDef
On Error Resume Next
Set ThisDB = CurrentDb
Set RS = ThisDB.OpenRecordset("Select fullMDBCoord from A2Kmdbs")
Open "c:\jack\LinkedTbls.log" For Append As #1
Do While Not RS.EOF
blnTitlePrinted = False
Debug.Print Now & " - Processing " & RS!fullmdbcoord
' If rs!fullmdbcoord <> "D:\A2K\db1_Backup.mdb" Then
' GoTo MoveIt
' End If
strDbPath = RS!fullmdbcoord
Set otherDB = OpenDatabase(strDbPath)
Set tdf = otherDB.TableDefs
Debug.Print "Checking tables in "; otherDB.name & vbTab & Now()
For i = 0 To tdf.Count - 1
MyBEPath = Mid(tdf(i).Connect, 10)
Debug.Print tdf(i).name
'Revised code to output to a file:
If MyBEPath <> "" Then
If blnTitlePrinted = False Then
Print #1, vbCrLf & vbCrLf & "Linked Tables in "; otherDB.name & vbTab & Now() & " JD " & vbCrLf & "=============================" & vbCrLf & vbTab & " Table" & vbTab & vbTab & vbTab & "Linked to" & vbCrLf
blnTitlePrinted = True
End If
Print #1, tdf(i).name & vbTab & " ------>>" & vbTab & MyBEPath
End If
Next i
Get_out:
otherDB.Close
Set otherDB = Nothing
MoveIt:
RS.MoveNext
Loop
....
.....
But I think the poster was asking about a library of shared procedures.
Suppose you have a lot of functions that could be used in many contexts.
In the old days with other languages this was a common subroutine library or something similar, or an api.
Many of us have countless databases from over the course of various assignments.
If you want to use the procedures/functions in these databases, you don't have to copy the procedures to the current database. and
you don't have to programmatically open the database with the procedure to use it.
You put your favorite, general use (even special circumstances - math, text manipulations...) functions into a library database
and just reference that library-- and all functions and procedures are readily available.