create an index with vba code

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top