create an index with vba code

D

Dirk Goldgar

jpeddie said:
how do I create an index on an access table with vba code?

You can do with DAO objects, by using the TableDef.CreateIndex method;
see the online help of Index Object. Or you can build and execute a SQL
CREATE INDEX statement.
 
T

Tim Ferguson

how do I create an index on an access table with vba code?

This comes straight from the Help files:

strSQL = "CREATE INDEX NewIndex " & _
"ON Employees " & _
"(HomePhone, Extension);"

db.Execute strSQL, dbFailOnError

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top