friends
1- Is this the right way to create an index on a table after created using VBA
2- how to set indexed = YES >>>>>Viea VBA Access
1- Is this the right way to create an index on a table after created using VBA
2- how to set indexed = YES >>>>>Viea VBA Access
Code:
Private Sub Command0_Click()
Dim db As Database
Set db = CurrentDb
With db.TableDefs("MyTable")
' Create first Index object, create and append Field
' objects to the Index object, and then append the
' Index object to the Indexes collection of the
' TableDef.
Set idxlinked = .CreateIndex("LinkedIndex")
With idxlinked
.Fields.Append .CreateField("First Name")
.Fields.Append .CreateField("Last Name")
.Fields.Append .CreateField("Course Title")
End With
.Indexes.Append idxlinked
End With
End Sub