Control Names

John Big Booty

AWF VIP
Local time
Tomorrow, 05:07
Joined
Aug 29, 2005
Messages
8,262
Once a control has been named and referenced a couple of times it becomes a fraught task to rename said control.

Is there an easy way that controls and their references can be globally renamed, so that the DB continues to work?
 
Name AutoCorrect options in Tools | Options | General tab is supposed to do something along those lines, but those options are also infamous for corrupting the database, so most recommend not to use it.

Also, it does not alter references in code, nor subqueries (and more).

There are several tools available, some are commercial, as SpeedFerret, ReplaceWiz and Find and Replace, I haven't used any of them, but here is a discussion about some of them from CDMA (the newsgroup Comp-Databases-MS-Access) http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/13fa0dcb6b30e2d3/, though I think it is fair to say that SpeedFerret hasn't been updated in the later years, and I don't think it works on 2003 versions, unless you also have the 2000 version on the same PC, or something like that.

A search also revelead there are freeware solutions out there. Here is one
http://www3.bc.sympatico.ca/starthere/findandreplace/

I don't use any of these products, and have no opinions on any of them. The one opinion I do have, is use a good naming convention from the start, then you won't need this ;)
 
If you just do a Find and Replace and tell it to search across the entire project instead of the current module, you can hit all of the code in one step. The trick is if you have that variable used in a lot of queries, where it seems to be hit or miss on whether or not it will update itself. The work-around is to rename your variable and then run each query separately, looking for when it prompts you for the old variable name. When that happens, you know you've found a query with an old reference that has to be updated. Roy is correct though -- get the name right first. It's part of the KISS method of programming. ;)

~Moniker
 
Thanks guys, all good points. The question arose because I had discovered that during the naming of one form of a set, I must have had a finger fire :o and in one of the form names I had spelt "Calc" as Cacl, and by the time I discovered the error I was too scarred to correct it for fear of missing a reference to it somewhere :(
I have found from past experience, that correcting apparently simple errors such as this, can cause more head aches than it's worth, and was wondering if there was a neat solution to the problem.
 

Users who are viewing this thread

Back
Top Bottom