I don't see a problem. Have you run it in debug mode and verified the value
of strTable?
--
Dave Hargis, Microsoft Access MVP
:
"DoCmd.DeleteObject ObjectType:=acTable, objectname:=strTable" where
"strTable" had previously been set to be = "tblCountries".
--
Still Grappling
:
Post your exact code, please
--
Dave Hargis, Microsoft Access MVP
:
The leading space was a mistake in my question but not in the original
database. I have tried to delete the table both by highlighting it in the
list of tables then selecting "delete" and by using "DoCmd.DeleteObject
acTable, 'tblCountries' " in VBA. Each time I got the same message about
invalid characters, yet I do not think I have used inavliad characters.
--
Still Grappling
:
It appears there is a leading space in the table name, which is a really,
really bad idea. I don't know if it will work, but try bracketing the name:
[ tblCountries]
Now, a word about naming. Use ONLY letters, numbers, and the underscore in
names. Do not use any Access reserved words (Date, Value, Description, etx).
Since there are words that you may forget are reserved and to be as clear as
possible as to the use of your names, use a good naming convention. Here is
a link that may be helpful:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_20naming.asp
--
Dave Hargis, Microsoft Access MVP
:
Whenever I try, I receive an error message that says: ' " is not a valid
name. Make sure that it does not include inavlid characters or punctuation
and that it is not too long.' The linked table I am trying to delete is
called: ' tblCountries' which does not appear to violate the rules.