If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Renmaing all controls on a form
How do I go about permanently renaming all controls on a form?
I am studying at Uni and the lecturer wants us to use 'Hungarian notation' for all controls, i.e. labels are named lblWhatever and textboxes txtWhatever etc. Happy with the results of using the forms wizards to save time, it takes ages to go through every form and see if the controls are correctly labelled and if not, change the control name. I was hoping to programmatically do this by doing something along the lines of: For each form in database open form for editing for each control in form being edited select type of control control is label if label hasn't already been renamed then rename label control is textbox if textbox hasn't already been renamed then rename textbox etc. etc. etc. then save the edited form But, how do I change all the underlying code on that form and in any modules, queries etc? Will my Button_onClick() event procedure automatically be able to find the, now renamed, cmdButton_onClick() procedure? How will my existing code find the newly renamed controls for SQL criteria? etc? Any assistance would be appreciated. P.S. I am trying to change about 35 forms in a database, each form is quite large with many controls - hence the reason for trying to find a faster way to achieve the aim. |
#2
|
|||
|
|||
While it's possible to write code to do it, it's a lot easier just to get a
3rd party product that'll do it for you. Ucora's: http://www3.bc.sympatico.ca/starthere/findandreplace/ is free, but I'm afraid I don't know anything about it. Find & Replace: http://www.rickworld.com/products.html is a very solid, fairly inexpensive product that I use. Speed Ferret: http://www.moshannon.com/speedferret.html is a bit more expensive, but I know many who swear by it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "SmilingPolitely" wrote in message ... How do I go about permanently renaming all controls on a form? I am studying at Uni and the lecturer wants us to use 'Hungarian notation' for all controls, i.e. labels are named lblWhatever and textboxes txtWhatever etc. Happy with the results of using the forms wizards to save time, it takes ages to go through every form and see if the controls are correctly labelled and if not, change the control name. I was hoping to programmatically do this by doing something along the lines of: For each form in database open form for editing for each control in form being edited select type of control control is label if label hasn't already been renamed then rename label control is textbox if textbox hasn't already been renamed then rename textbox etc. etc. etc. then save the edited form But, how do I change all the underlying code on that form and in any modules, queries etc? Will my Button_onClick() event procedure automatically be able to find the, now renamed, cmdButton_onClick() procedure? How will my existing code find the newly renamed controls for SQL criteria? etc? Any assistance would be appreciated. P.S. I am trying to change about 35 forms in a database, each form is quite large with many controls - hence the reason for trying to find a faster way to achieve the aim. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ECHO Causing Problems | DS | General Discussion | 5 | May 17th, 2005 02:19 AM |
Controls are not visible in Form View | jgreg | General Discussion | 1 | February 15th, 2005 03:25 PM |
open a form through a subform in access 2000 | Tammy | Setting Up & Running Reports | 12 | October 22nd, 2004 02:43 PM |
Controls disappear when form is empty | MikeC | Using Forms | 5 | July 27th, 2004 05:31 AM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |