I have two .mdb files and when I link them in VB I want to check that a custom property (one I've created to keep track of table structures) matches. I've written a function in one .mdb to look up the custom property of the other .mdb but it's isn't working. I get the error that the property is not found even though I am 100% sure it's there...
Any ideas??
Function GetRemoteCustomProperty(RemoteDBFile As String, Property As String) As Variant
On Error GoTo Err_GetRemoteCustomProperty
Dim RemoteDB As Database
Set RemoteDB = DBEngine.Workspaces(0).OpenDatabase(RemoteDBFile)
RemoteDB.Containers!Databases.Documents!UserDefined.Properties.Refresh
GetRemoteCustomProperty = CurrentDb.Containers!Databases.Documents!UserDefined.Properties(Property)
Exit_GetRemoteCustomProperty:
Exit Function
Err_GetRemoteCustomProperty:
MsgBox Err.Description
Resume Exit_GetRemoteCustomProperty
End Function
Any ideas??
Function GetRemoteCustomProperty(RemoteDBFile As String, Property As String) As Variant
On Error GoTo Err_GetRemoteCustomProperty
Dim RemoteDB As Database
Set RemoteDB = DBEngine.Workspaces(0).OpenDatabase(RemoteDBFile)
RemoteDB.Containers!Databases.Documents!UserDefined.Properties.Refresh
GetRemoteCustomProperty = CurrentDb.Containers!Databases.Documents!UserDefined.Properties(Property)
Exit_GetRemoteCustomProperty:
Exit Function
Err_GetRemoteCustomProperty:
MsgBox Err.Description
Resume Exit_GetRemoteCustomProperty
End Function