Mass change to field found in reports, etc. (1 Viewer)

mjwillyone

Registered User.
Local time
Yesterday, 18:37
Joined
Aug 3, 2004
Messages
27
Years ago I created an Access database that holds employee information. There are multiple reports, queries, etc. I am working on a project and realize that I was not very smart in giving some of my database field names two words (i.e. First Name, Last Name, etc.). I should have used an underling (_) to connect the two words. I cannot proceed with the work I am now doing until I get the field names in the reports, queries, etc. changed. I have changed one of the field names in the table but that is the only one.

I am wondering if there is a way that I can create some VBA or other code that will basically do a search/replace so I will not have to find all the places where the code needs to be changed. One field in particular would be a bear to update manually. It is a field that is often used as a sort criteria for reports, etc.

Thank you for your help,
Mike
 

workmad3

***** Slob
Local time
Today, 00:37
Joined
Jul 15, 2005
Messages
375
have you tried putting square brackets around the field names? i.e. [Field Name] as thats the standard way of getting a space recognised as part of the field name in access.
 

mjwillyone

Registered User.
Local time
Yesterday, 18:37
Joined
Aug 3, 2004
Messages
27
Actually, I am attempting to link the database into another application and the other application gives errors due to the two-word field names. That is why I am wanting to change the field names to one-word instead.

Thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:37
Joined
Feb 19, 2002
Messages
43,466
If you are using A2K or newer, you can use the name auto correct feature to do much of the dirty work. It will cascade the name changes from the table to queries, forms, and reports. You will need to change code and macros manually.

Before turning this feature on, make a back up because the feature doesn't work the way you might expect in all cases. Search the MSDN library for a very good, detailled article on this feature and how it works.

There are also third-party products such as speedferret that you might find easier to use. There are also shareware products but you'll need to search for them.
 

Users who are viewing this thread

Top Bottom