L
LGarcia
Hi All,
I have an EntryDB that contains links to tables in MyDataDB. I need to look
in MyDataDB for "tblAllNutr". If this table exists I then need to link it
to my EntryDB.
I use this code to evaluate if a table exists but it only looks at currently
linked tables. Can I modify this code to look in MyDataDB?
Public Function DoesObjectExist(ObjectName$)
On Error Resume Next
Dim Found_Object, Find_Object As String
Found_Object = -1
Find_Object = CurrentDb.TableDefs(ObjectName$).Name
If Err = 3265 Or Find_Object = "" Then
Found_Object = 0
End If
DoesObjectExist = Found_Object
End Function
I use this code to return the full path of MyDataDB:
CurrentDb.TableDefs("tblIntakeCV").Connect
MyDataDB is only used as an example. The true name of this DB is usually
project based.
"tblIntakeCV" will always reside in this DB but this is not true for
"tblAllNutr".
Hope someone can help!
Thanks,
LGarcia
I have an EntryDB that contains links to tables in MyDataDB. I need to look
in MyDataDB for "tblAllNutr". If this table exists I then need to link it
to my EntryDB.
I use this code to evaluate if a table exists but it only looks at currently
linked tables. Can I modify this code to look in MyDataDB?
Public Function DoesObjectExist(ObjectName$)
On Error Resume Next
Dim Found_Object, Find_Object As String
Found_Object = -1
Find_Object = CurrentDb.TableDefs(ObjectName$).Name
If Err = 3265 Or Find_Object = "" Then
Found_Object = 0
End If
DoesObjectExist = Found_Object
End Function
I use this code to return the full path of MyDataDB:
CurrentDb.TableDefs("tblIntakeCV").Connect
MyDataDB is only used as an example. The true name of this DB is usually
project based.
"tblIntakeCV" will always reside in this DB but this is not true for
"tblAllNutr".
Hope someone can help!
Thanks,
LGarcia