I am following the code example for RunMailMerge in faq181-5088. This looks like a great way to accomplish mail merges in access. However, I am having some problems right of the bat. The Function CurrentBackendPath() is not working properly. It errors out on the following line:
str = CurrentDb().TableDefs(strTableName).Connect
with the "Item not found in this collection". I have referenced the DAO 3.6 objects. What am I missing? It appears to not like TableDefs. This is Access 2003 working with an Access 2000 format db.
Any help would be greatly appreciated! Here is the entire function for reference:
Private Function CurrentBackendPath() As String
Const JETDBPrefix As String = ";DATABASE="
Const strTableName As String = "GLOBALS"
Dim str As String
Dim idx As Integer
str = CurrentDb().TableDefs(strTableName).Connect
idx = InStr(1, str, JETDBPrefix, vbTextCompare)
str = Mid(str, idx + Len(JETDBPrefix))
CurrentBackendPath = GetPath(str)
End Function
Thanks!
str = CurrentDb().TableDefs(strTableName).Connect
with the "Item not found in this collection". I have referenced the DAO 3.6 objects. What am I missing? It appears to not like TableDefs. This is Access 2003 working with an Access 2000 format db.
Any help would be greatly appreciated! Here is the entire function for reference:
Private Function CurrentBackendPath() As String
Const JETDBPrefix As String = ";DATABASE="
Const strTableName As String = "GLOBALS"
Dim str As String
Dim idx As Integer
str = CurrentDb().TableDefs(strTableName).Connect
idx = InStr(1, str, JETDBPrefix, vbTextCompare)
str = Mid(str, idx + Len(JETDBPrefix))
CurrentBackendPath = GetPath(str)
End Function
Thanks!