Need help to change table field name in every access object (1 Viewer)

Amr Ashraf

New member
Local time
Today, 14:16
Joined
Apr 14, 2021
Messages
28
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
 

arnelgp

once i caught a fish alive...
Local time
Today, 20:16
Joined
May 7, 2009
Messages
13,202
i understand if you will change the field's datatype, but field name?
you can Alias it in query, change caption in report/form.
 

bastanu

AWF VIP
Local time
Today, 05:16
Joined
Apr 13, 2010
Messages
820
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,
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:16
Joined
Feb 19, 2002
Messages
32,221
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

  • NameAutoCorrectDOC.zip
    81.3 KB · Views: 41
  • NameAutocorrectPPT.zip
    182.7 KB · Views: 51

bastanu

AWF VIP
Local time
Today, 05:16
Joined
Apr 13, 2010
Messages
820
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.

 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:16
Joined
Feb 19, 2002
Messages
32,221
It may be 20 years old but the function still works the same way and still traps people..
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:16
Joined
Feb 19, 2013
Messages
13,093
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)
 

sys00

New member
Local time
Today, 15:16
Joined
Feb 3, 2020
Messages
13
Hi, this is from my archiver
 

Attachments

  • a0.png
    a0.png
    22.3 KB · Views: 52
  • n12345.zip
    89.6 KB · Views: 46

Users who are viewing this thread

Top Bottom