Need help to change table field name in every access object (2 Viewers)

VBANewBie :)

Member
Local time
Today, 17:07
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:07
Joined
May 7, 2009
Messages
19,169
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, 08:07
Joined
Apr 13, 2010
Messages
1,401
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, 11:07
Joined
Feb 19, 2002
Messages
42,970
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: 543
  • NameAutocorrectPPT.zip
    182.7 KB · Views: 289

bastanu

AWF VIP
Local time
Today, 08:07
Joined
Apr 13, 2010
Messages
1,401
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, 11:07
Joined
Feb 19, 2002
Messages
42,970
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, 15:07
Joined
Feb 19, 2013
Messages
16,553
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, 18:07
Joined
Feb 3, 2020
Messages
16
Hi, this is from my archiver
 

Attachments

  • a0.png
    a0.png
    22.3 KB · Views: 316
  • n12345.zip
    89.6 KB · Views: 278

Users who are viewing this thread

Top Bottom