I was able to reproduce your problem. I commented out the lines as below:
Public Sub ShowHideTables(blnHide As Boolean)
Dim tbl As TableDef
Dim strTblName As String
For Each tbl In CurrentDb.TableDefs
strTblName = tbl.Name
' If Left(strTblName, 4) <> "Msys" Then
Application.SetHiddenAttribute acTable, strTblName, blnHide
' End If
Next tbl
Set tbl = Nothing
End Sub
I did it from a front end with linked tables. If you don't have the lines
in to filter out system tables (those that start with Msys), you will get
that error. If you entered the code as written and you are still having the
error, when it goes to debug mode, check the value of the variable
strTblName.
Let me know what happens.