find a reference to a form name

D

dvdbrett

I changed the name of a form and now I get the startup error "the form is
misspelled or does not exist". Everything else seems to work right. How do I
search for all of the controls and modules with macros and code so I can find
the reference to the old form name?
 
D

dymondjack

Some versions of Access are supposed to do this for you, but I've never
relied on it.

If I need to change the name of a form after I've done a decent amount
behind the scenes with it, I generally Copy/Paste with a new name... this
seems to do a pretty decent job for the Access interface (event procedures
behind the form anyway)... you will then need to open the VBA window and
CTRL+H (find & replace) for code specifics (though it's generally bad
practice to hardcode form names, specifically for this reason).

If this is a startup form you may need to go back to the db startup options
and select the form from the list again.

I think you'll still have to manually find any related controls on other
forms that may reference it.

You could write a function that grabs each form, runs the controls, checks
properties, and changes the value each time "formname" is found, but that's
some pretty serious coding.

That still leaves Macros... I'm not sure about that one either.

So... no easy answer, that I know of. Getting yourself into a good naming
convention for objects is essential for reasons such as this, though coming
up with one that works well for you generally takes a while.

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
D

Dale Fye

Although all of these options have associated costs, they can/will pay for
themselves the first time you really need them (assuming you are doing this
for work and can justify the purchase).

You might want to checkout: http://www.rickworld.com/index.html

Rick Fisher has a Find and Replace utility that does a pretty good job of
this.

If you are using a version of Access prior to 2003, (or are using 2003 and
still have an earlier version (97, 2000, 2002) installed, then you could also
checkout the application "Speed Ferret", which I have used extensively, and
found to be extremely useful (if slightly out-of-date).

I think Total Access Analyzer from FMS
(http://www.fmsinc.com/MicrosoftAccess/BestPractices.html) will also work for
finding all the occurances, but I don't think it has a "Find and Replace"
functionality, so you have to do the search, and manually replace.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top