Hello:
The attached VBA in form "F_RenameFields scans through all tables and renames existing field [TITLE] into, e.g., [XXX].
For testing purposes only, the position of field [TITLE] has been moved across all sample tables (Table1, Table2, Table3).
This works great!
//
What I need some assistance with is as follows:
- Modify the existing VBA so that it does NOT search for field [TITLE] but instead changes *any field* that is located in the first position in the table.
- For example, in "Table1" the existing field [LASTNAME] would be changed to [XXX].
- Alternatively, in "Table2", the first field happens to be [TITLE] so this would turn into [XXX].
- Finally, in "Table3" [GENDER] now would be changed to [XXX].
My question:
How does the "n.Name" variable [in line "n.Name = Replace(oldname, "TITLE", "XXX")] have to be changed so that it's not looking for [TITLE] but instead rename the 1st field in each table?