Need help to change table field name in every access object

VBANewBie :)

Member
Local time
Today, 09:15
Joined
Apr 14, 2021
Messages
88
Hi guys is it possible to automatically update the name of a field in every access object (Queries-Forms-Reports-Vba Codes) ? if i change that field name in a table , I have a field name i need to change in one basic table in my database which mentioned in like 100 query, report , form , vba code .
Thanks
 
i understand if you will change the field's datatype, but field name?
you can Alias it in query, change caption in report/form.
 
I would start with trying the built-in Name Autocorrect feature. Make a backup copy of your file, enable the three check boxes under File\Options\Current Database\Name Autocorrect do a compact and repair then open the table in design view and rename the field. Your changes should propagate in all related (dependant) objects other than the VBA code where you can do a global Find and Replace (do a Find in entire project).

Cheers,
 
Name Auto Correct does not work the way you think it does. The changes are not propagated immediately. They don't happen until the affected object is opened the NEXT time. This is why people get messed up by it. They make the mistake of compounding the changes. or turning off NameAutoCorrupt before all the changes have been propagated.
 

Attachments

That white paper is almost 20 years old, I would have hoped Microsoft would have improved it since. In their current documentation they say it "automatically fixes" the other objects:
Perform name AutoCorrect When this option is selected, Access automatically fixes name changes as they occur. You can select this option only if the Track name AutoCorrect info option is already selected. To perform name AutoCorrect, Access uses the name maps that it created when the Track name AutoCorrect info option was enabled.

 
It may be 20 years old but the function still works the same way and still traps people..
 
it won't change names in vba code but easy enough to use find/replace - just remember if you are changing a generic word such as 'name' to 'custname' then in vba if you have 'productname' it will change to productcustname' unless you replace ' name' - include a space before (yet another reason for not using spaces)
 
Hi, this is from my archiver
 

Attachments

  • a0.png
    a0.png
    22.3 KB · Views: 403
  • n12345.zip
    n12345.zip
    89.6 KB · Views: 350

Users who are viewing this thread

Back
Top Bottom