How to change a table's 'Indexed' from Yes to No in VBA
Posted on 2014-04-02
I need to drop the Primary Key AND remove indexing from the Primary Key field, and have used the following command successfully in the past:
DoCmd.RunSQL "DROP INDEX PrimaryKey ON tbAccounts_WithDuplicatesForReports"
This command NOW drops the PrimaryKey, but the 'Indexed' property remains "Yes (No Duplicates)", but when I used it before, this command also changed the 'Indexed' property to "No".
Recently I have had to reconstruct the table, so something might be different from what it was before, but I was careful to copy all field names from the original, and the names are identical.