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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.Open referencing deleted Macro (Err: 2485)

Status
Not open for further replies.

robz2009

Programmer
Apr 20, 2009
41
GB
I am in the process of converting an Access 2.0 database to Access 2000 and am trying to strip a lot of the functionality (basically to streamline it and make it less complicated). I would like to remove most Macros but now when attempting to open a form I get the error,

“Run-time error ‘2485’;

<App Name> can’t find the macro <Macro Name>”

As a quick fix I can simply restore the Macro but where is this pre-set against the form? Surely the code in my form (“DoCmd.OpenForm "Form Main Menu", , , , , acDialog”) is not dependent on a macro being setup?

Any info/guidance would be grateful.
 
It seems likely that the macro is set against an event for the form or a control, that is, it is typed in like so:


On Load : Macro1.SomeMacro

If you suspect that this is happening a lot, it is not so difficult to loop through the forms and controls to find macros. I have some code somewhere.

 
I could understand that as I have looked at the code and the form it's trying to open has nothing in the Form events.

I have tried searching the Macro name and parts of the macro name via a simple text search but still no luck.

I have searched a number of online forums and done my own investigation before putting this post but have really hit a brick wall :(
 
No, as stated I have had to restore the Macro which was being referenced in order for this Application to work again.

The form being referenced in the DoCmd.OpenForm does not have any reference to the Macro in it's code. There is nothing setup in the Form events and the controls on the form are Command buttons which simply open further forms using the same DoCmd.OpenForm syntax.

I cannot see a reference to this Macro in the VBA code, could it be setup somewhere else in Access?

Can I put a pause\break on the Macro so it'll show me where in Debug this is being called from?
 
I have not tried this. How about putting a message box in as part of the macro and further message boxes in a few events, say, open, load and current? This may narrow down the possibilities.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top