A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Renmaing all controls on a form



 
 
Thread Tools Display Modes
  #1  
Old June 11th, 2005, 12:46 AM
SmilingPolitely
external usenet poster
 
Posts: n/a
Default 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  
Old June 11th, 2005, 01:10 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.