Re: ERROR with no direction on how to fix - " is not a valid name...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I found this as a possible solution (in microsoft Groups) {I am having
this problem and will try the answer when I get a chance)

=========================

Hi Lindsay,

If it is a 2003 or earlier database and your have Access 2003 or
earlier, you can relink the tables using the earlier version.

Alternatively, to fix it in Access 2007 do something like this:

Public Sub DealWithApostrophes()

Dim dbCurrent As DAO.Database

Set dbCurrent = CurrentDb
With dbCurrent.TableDefs("tblJohn's Table")
..Connect = Replace(.Connect, "'", "")
..RefreshLink
End With
Set dbCurrent = Nothing

End Sub

Where "tblJohn's Table" is a table in a database with a name with an
apostrophe such as "C:\John's Data\John's Data.accdb". Fix the entire
path
of the database so that there are no apostrophes anywhere. Note that
the
table name can continue to have apostrophes. Then with the above code
in a
regular (not class, form or report) module, place your cursor anywhere
inside
of the code and press F5 to run it.

Good Luck!

Clifford Bass
=======================
Ron
.



Relevant Pages