So, halfway to resolving...
The error occurred in the function TablesMatch, which is...
Private Function TablesMatch(strFileName As String) As String
On Error GoTo ErrorHere
Dim intFlag As Integer, dbLocal As Database, dbBackEnd As Database
Dim tdLocal As TableDef, tdBackEnd As TableDef, strReturn As String
Dim strLocalTableStriped As String
intFlag = False ' Initial value, process by exception.
Set dbLocal = CurrentDb
Set dbBackEnd = DBEngine(0).OpenDatabase(strFileName)
Set dbLocal = CurrentDb
For Each tdLocal In dbLocal.TableDefs ' Loop through local tables.
If Len(tdLocal.Connect) > 0 Then ' This is an attached table.
For Each tdBackEnd In dbBackEnd.TableDefs ' Loop thru back-end
strLocalTableStriped = StripPrefix(tdLocal.SourceTableName)
strReturn = strLocalTableStriped
'Debug.Print strLocalTableStriped & " <> " & tdBackEnd.Name
If strLocalTableStriped = tdBackEnd.Name Then
intFlag = True ' We found a match in back-end.
Debug.Print "-- Found it! -- " & tdBackEnd.Name
Exit For ' Jump out for next search.
End If
Next
If intFlag = False Then ' No match for this attached table.
TablesMatch = strReturn
Exit Function
Else ' There was a match--continue searching next attachment.
intFlag = False ' Reset flag for next table test.
End If
End If
Next
' If the function reached here, all tables matched.
TablesMatch = "OK"
ExitHere:
Exit Function
ErrorHere:
Call LogError(Application.CurrentObjectName, "TablesMatch", Err.Number, Err.Description, False)
Resume ExitHere
End Function
The first time this is called from the function RelinkAccess it reports the first table name rather than the status "OK". So clearly a problem. I removed it from the function RelinkAccess (where it checks if all TablesMatch) and ran the contents of the contents
of the IF/THEN/ELSE without confirming that TablesMatch. Everything ran, BUT didn't get all tables. (for my reference it crapped out on T09 WHICH WAS A TABLE THAT HAD BEEN DELETED FROM THE BE, BUT STILL APPEARED IN THE FE). Ran everything a 2nd time AND EVERYHTING
WORKED FINE.
So I have been chastised by Microsoft to not shout and to prove it is not the network by getting the same error on a no network setup. Other's smarter than me have proven this. So I am STILL SHOUTING MICROSOFT!
SHOUTING ARE YOU ACTIVE ON RESOLVING THIS ACCESS PROBLEM SOON AS IT HAS GIVEN MILLIONS OF PEOPLE PROBLEMS DAILY AND ENOUGH IS ENOUGH. I WILL CONTINUE TO SHOUT. IT HAS BEEN SINCE WIN7 AND CONTINUES INTO WIN 8.1 AND I BELIEVE HAS A COMPOUND ISSUE SOME RELATED
TO THE CHANGES IN NETWORK HANDLING IN WINDOWS AND SOME RELATED TO ACCESS NOT COMPLYING WITH YOUR OWN "IMPROVEMENTS" TO NETWORK ALGORITHMS.
Maybe if I stop shouting and ask Please, pretty Please?