I'm having a strange problem relating to running code I found in another thread. The code is as follows.
dim db as dao.database
dim td as dao.tabledef
set db = currentdb
on error resume next
td = db.tabledefs("mytablename")
if err.number<>0 then
' not found - do something?
err.clear
end if
When run it hangs on the "td = db.tabledefs..." line and reports an "invalid use of property" error. I have the reference set to the MS DAO 3.6 Object Library and I can't see any problem with the code.
dim db as dao.database
dim td as dao.tabledef
set db = currentdb
on error resume next
td = db.tabledefs("mytablename")
if err.number<>0 then
' not found - do something?
err.clear
end if
When run it hangs on the "td = db.tabledefs..." line and reports an "invalid use of property" error. I have the reference set to the MS DAO 3.6 Object Library and I can't see any problem with the code.