I created this function now using MSysRelationships.
************************************************** **************************
************
Public Function FindFieldRelatedTable(ByVal strTableName As String, ByVal
strFieldName As String) As String
On Error GoTo errHandling
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set conn = New ADODB.Connection
Set conn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "SELECT MSysRelationships.szReferencedObject FROM
MSysRelationships WHERE (((MSysRelationships.szObject)='" & strTableName &
"') AND ((MSysRelationships.szReferencedColumn)='" & strFieldName & "'));",
conn, adOpenForwardOnly, adLockReadOnly, adCmdText
FindFieldRelatedTable = rs.Fields(0).Value
rs.Close
Set rs = Nothing
Exit Function
errHandling:
MsgBox "Foutnr. " & Err.Number & " in functie FindFieldRelatedTable " &
Chr(13) & Err.Description
End Function
************************************************** **************************
******
"Filips Benoit" <be***********@pandora.be> wrote in message
news:Ve*****************@phobos.telenet-ops.be...
Dear All,
Is ( how) it possible to find the tablename of the table that is related
to a field.
Field CLIENT_TITLE_ID is related to table TITLE
Thanks,
Filip