Re: ERROR with no direction on how to fix - " is not a valid name...
- From: Ron2006 <ronnemec@xxxxxxxxxxx>
- Date: Tue, 26 May 2009 13:12:15 -0700 (PDT)
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
.
- References:
- Prev by Date: Re: Data Type Mismatch in Criteria Expression
- Next by Date: Re: Change the SQL in an existing MS Access query
- Previous by thread: Re: ERROR with no direction on how to fix - " is not a valid name...
- Next by thread: Next record in current row
- Index(es):
Relevant Pages
|