I use the following function, though there may be a built-in one through syscmd function, where p_tabname$ is the name of a table local to the mdb.<br>
<br>
Function ztablocation(p_tabname$) As String<br>
<br>
Dim l_db As Database, l_rs As Recordset<br>
Set l_db = CurrentDb()<br>
Set l_rs = l_db.OpenRecordset("Select Distinctrow MsysObjects.Database from MsysObjects where MsysObjects.Name = '" & p_tabname$ & "' and MsysObjects.Type =6", dbOpenSnapshot)<br>
If Not l_rs.EOF Then<br>
l_dbname = l_rs!Database<br>
Else<br>
l_dbname = l_db.Name<br>
End If<br>
l_rs.Close<br>
ztablocation = l_dbname<br>
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.