Forum Discussion

RoyLehmann's avatar
RoyLehmann
Copper Contributor
Jun 11, 2022
Solved

Tabledef Indexes Append

Procedure compiles correctly but gives the following error: Run time error 3409 Invalid field definition "PrimaryIndex" in definition of index. Instruction flagged: tdfMenu.Indexes.Append idxPrim...
  • arnel_gp's avatar
    Jun 12, 2022
    you don't have "PrimaryIndex" field name when you created the Table.
    you select from the table field which one is the Field you are Indexing:
    to make "key" field the Primary Index:

    ...
    ...
    With idxPrimary
    .Fields.Append idxPrimary.CreateField("key")
    .Primary = True
    End With

    tdfMenu.Indexes.Append idxPrimary

Resources