The TableDefs() collection is not slow to deal with, so there are probably
other factors here.
Examples:
- How did you set myDB? CurrentDb() creates an instance each time it is
called, and flushes all collections, so a single call to myDB instead of
multiple calls makes a huge difference.
- Attached tables? Try an OpenDatabase() directly on the back end until your
code completes. You don't actually use this Database variable, but the file
open, and so yields much faster results.
- Name AutoCorrect can cause lots of problems as all names are passed
through it first.
- How long is the path name in the Connect property of the TableDef? Believe
it or not, that makes a major difference also.
For several other general suggestions on performance in Access, see:
http://www.granite.ab.ca/access/performancefaq.htm
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"BUX" <No****@NoSpam. it> wrote in message
news:i3******** *************** *********@4ax.c om...
I have to look in Index property of myTable, but
Set myTableDef = myDB.TableDefs( myTable)
is so slow ....
Do you now any other fast way?
thank you