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  

Removing a form and all of the module code for it



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2004, 11:55 AM
Jack Gillis
external usenet poster
 
Posts: n/a
Default Removing a form and all of the module code for it

I have a form that I no longer use and would like to remove it and all
of its code in Modules. The first part is easy, but I've no idea how to
go about removing all the code unique to it in the Modules. What would
be the best way to go about discovering which code is associated with
that form and that form alone?

Thank you.


  #2  
Old July 25th, 2004, 01:18 PM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default Removing a form and all of the module code for it

I would just delete the form and not worry about any other outside code that
may be associated with it. It is not as likely that procedures unique to
that form alone will be defined in standard modules. If you really insist
that all unique code be deleted, proceed as follows.

MAKE BACKUP COPIES

1. Turn on "Require variable declaration" in the options menu of the code
window.
2. Check for any global variables used on that form, but not declared there.
3. Look in the form too see if any outside procedure are called. Calling a
function will be proceeded by the word "Call" for user defined functions.
Right click on the function name and choose "Definition" to find the
associated code. Outside Subs are not proceeded by the word "Call", but can
be found the same way.
4. Do not delete any outside code yet, just mark the above with something
unique, like a comment with your initials and the date.
5. Delete the form, then compact the database.
6. Compile the database, correcting any undeclared variables.
7. Search for each of your marked comments, then do a search on each
variable or sub name that has been marked. If you find any, the code has
other use and can't be deleted. If not, go ahead and delete the unused code,
secure in the knowledge that you have good backups if things go wrong.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access


"Jack Gillis" wrote in message
...
I have a form that I no longer use and would like to remove it and all
of its code in Modules. The first part is easy, but I've no idea how to
go about removing all the code unique to it in the Modules. What would
be the best way to go about discovering which code is associated with
that form and that form alone?

Thank you.




  #3  
Old July 25th, 2004, 01:31 PM
Jack Gillis
external usenet poster
 
Posts: n/a
Default Removing a form and all of the module code for it

Thank you Arvin.

The code I am referring to, and I should have pointed it out, is the
code I created myself when I set up the data base. I recognize some of
it but not all.

Not worrying about that sort of code, code no longer needed, is one of
the things in my opinion that has led to today's software bloat.

Thanks again.


"Arvin Meyer" wrote in message
...
I would just delete the form and not worry about any other outside

code that
may be associated with it. It is not as likely that procedures unique

to
that form alone will be defined in standard modules. If you really

insist
that all unique code be deleted, proceed as follows.

MAKE BACKUP COPIES

1. Turn on "Require variable declaration" in the options menu of the

code
window.
2. Check for any global variables used on that form, but not declared

there.
3. Look in the form too see if any outside procedure are called.

Calling a
function will be proceeded by the word "Call" for user defined

functions.
Right click on the function name and choose "Definition" to find the
associated code. Outside Subs are not proceeded by the word "Call",

but can
be found the same way.
4. Do not delete any outside code yet, just mark the above with

something
unique, like a comment with your initials and the date.
5. Delete the form, then compact the database.
6. Compile the database, correcting any undeclared variables.
7. Search for each of your marked comments, then do a search on each
variable or sub name that has been marked. If you find any, the code

has
other use and can't be deleted. If not, go ahead and delete the unused

code,
secure in the knowledge that you have good backups if things go wrong.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access


"Jack Gillis" wrote in message
...
I have a form that I no longer use and would like to remove it and

all
of its code in Modules. The first part is easy, but I've no idea

how to
go about removing all the code unique to it in the Modules. What

would
be the best way to go about discovering which code is associated

with
that form and that form alone?

Thank you.






  #4  
Old July 25th, 2004, 02:15 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Removing a form and all of the module code for it

Are you talking about code that you created in the module assocated with the
form itself, or code that you created in a separate module? In other words,
when you open the code module, is its name Form_name of your form or is it
something else.

If the former, deleting the form will delete the module as well.

If the latter, then consider purchasing something like Total Access Analyzer
from FMS
http://www.fmsinc.com/products/analyzer/index.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Jack Gillis" wrote in message
...
Thank you Arvin.

The code I am referring to, and I should have pointed it out, is the
code I created myself when I set up the data base. I recognize some of
it but not all.

Not worrying about that sort of code, code no longer needed, is one of
the things in my opinion that has led to today's software bloat.

Thanks again.


"Arvin Meyer" wrote in message
...
I would just delete the form and not worry about any other outside

code that
may be associated with it. It is not as likely that procedures unique

to
that form alone will be defined in standard modules. If you really

insist
that all unique code be deleted, proceed as follows.

MAKE BACKUP COPIES

1. Turn on "Require variable declaration" in the options menu of the

code
window.
2. Check for any global variables used on that form, but not declared

there.
3. Look in the form too see if any outside procedure are called.

Calling a
function will be proceeded by the word "Call" for user defined

functions.
Right click on the function name and choose "Definition" to find the
associated code. Outside Subs are not proceeded by the word "Call",

but can
be found the same way.
4. Do not delete any outside code yet, just mark the above with

something
unique, like a comment with your initials and the date.
5. Delete the form, then compact the database.
6. Compile the database, correcting any undeclared variables.
7. Search for each of your marked comments, then do a search on each
variable or sub name that has been marked. If you find any, the code

has
other use and can't be deleted. If not, go ahead and delete the unused

code,
secure in the knowledge that you have good backups if things go wrong.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access


"Jack Gillis" wrote in message
...
I have a form that I no longer use and would like to remove it and

all
of its code in Modules. The first part is easy, but I've no idea

how to
go about removing all the code unique to it in the Modules. What

would
be the best way to go about discovering which code is associated

with
that form and that form alone?

Thank you.








  #5  
Old July 25th, 2004, 07:07 PM
Jack Gillis
external usenet poster
 
Posts: n/a
Default Removing a form and all of the module code for it


"Douglas J. Steele" wrote in message
...
Are you talking about code that you created in the module assocated

with the
form itself, or code that you created in a separate module? In other

words,
when you open the code module, is its name Form_name of your form or

is it
something else.


Thank you very much.

Good question! I suspect I put some of it in two or three modules I
created. Why I chose to do that modules, I haven't a clue becaue it was
so long ago (I'm talking about Acces 97 ) and it was my first attempt at
VBA.. But those modules probably include code not specific to the form
I want to delete.

With that in mind, I think the best approach would be to rename the
public subs and functions one by one and see what happens to determine
which are use only by the form in question.

I have since learned how to better organize the modules and did so in
subsequent db's.

Thanks again.

If the former, deleting the form will delete the module as well.

If the latter, then consider purchasing something like Total Access

Analyzer
from FMS
http://www.fmsinc.com/products/analyzer/index.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Jack Gillis" wrote in message
...
Thank you Arvin.

The code I am referring to, and I should have pointed it out, is the
code I created myself when I set up the data base. I recognize

some of
it but not all.

Not worrying about that sort of code, code no longer needed, is one

of
the things in my opinion that has led to today's software bloat.

Thanks again.


"Arvin Meyer" wrote in message
...
I would just delete the form and not worry about any other outside

code that
may be associated with it. It is not as likely that procedures

unique
to
that form alone will be defined in standard modules. If you really

insist
that all unique code be deleted, proceed as follows.

MAKE BACKUP COPIES

1. Turn on "Require variable declaration" in the options menu of

the
code
window.
2. Check for any global variables used on that form, but not

declared
there.
3. Look in the form too see if any outside procedure are called.

Calling a
function will be proceeded by the word "Call" for user defined

functions.
Right click on the function name and choose "Definition" to find

the
associated code. Outside Subs are not proceeded by the word

"Call",
but can
be found the same way.
4. Do not delete any outside code yet, just mark the above with

something
unique, like a comment with your initials and the date.
5. Delete the form, then compact the database.
6. Compile the database, correcting any undeclared variables.
7. Search for each of your marked comments, then do a search on

each
variable or sub name that has been marked. If you find any, the

code
has
other use and can't be deleted. If not, go ahead and delete the

unused
code,
secure in the knowledge that you have good backups if things go

wrong.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access


"Jack Gillis" wrote in message
...
I have a form that I no longer use and would like to remove it

and
all
of its code in Modules. The first part is easy, but I've no

idea
how to
go about removing all the code unique to it in the Modules.

What
would
be the best way to go about discovering which code is associated

with
that form and that form alone?

Thank you.










 




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


All times are GMT +1. The time now is 03:01 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.