Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating VB when changing field names

Status
Not open for further replies.

airbus2

Technical User
Apr 16, 2008
31
US
I have to overhaul a db. When I change a Form or table name or field name, is there a way to auto update VB without going into each statement and updating the code. There are literally 100 of them.
 
Use find and replace? If so, open any vba code window and be sure that in the Search section you click on the Current Project radio button and then it will search all your forms and modules vba code for the item you are searching to replace.
 
yeap,

no auto updates, only search and replace, make sure you replace exactly what you need.
e.g.

you need to replace a variable Myid for MyPK but then you have calls for subs Myid_routine, then all Myid's will be replaced including the ones not desired.
 
What benefit are you expecting from changing field names in the database? As a general rule I leave these alone, since changing them can break many things and it will not increase your performance.

If you are changing them because the field names are obscure, this is something I would fix at the presentation level (give aliases to field names in queries, change report labels, etc.).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top