I have a task in Access 2016 where I'm required to create a primary key consisting of multiple fields. I need to do it in VBA code using the DAO model. This is because it is a repetitive task and I need to loop through multiple tables setting a primary key each time the tables are replaced. From what I can gather, what is needed are multiple fields to be added to the indexes collection and the primary key properties are set before the index is appended to the collection. I would really prefer to receive some example code using VBA and DAO in Access so that I can work with the example and adapt it to my situation. Thank you.
If Helen Feddema is available, that would be good.