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

Macro Not Foud but no Macro Specified

Status
Not open for further replies.

Dummy99

Programmer
Apr 25, 2002
30
0
0
FR
I have two reports (Keys & Info) with a customized Toolbar which includes an "Exit" button and this "Exit" button was tied to a macro called "MM.ExitBtn". These reports get opened via Menu Form X.

I later introduced a Menu Form Y to selectively preview print records using form "Info".

I then converted the macro to a VBA Event Procedure and with the report "Info" displayed in Design mode I changed the Customized Exit Button to link to the Event Procedure. And I deleted the MM macro.

When I open the "Info" report from Menu Form Y, the Exit button works beatifully. But if the "Keys" or the "Info" reports are opened from Menu Form X, the Exit button results in "MS Access can't find the Macro MM."

In all three cases the report is opened in the same way except for a Selection Condition when opened from Menu Form Y, i.e.,

From Menu For X:
DoCmd.OpenReport "Keys", acPreview
DoCmd.OpenReport "Info", acPreview

From Menu Form Y:
DoCmd.OpenReport "Info", acViewPreview, , "[keyid] = [Forms]![SelSol].[SelKey]"

The Customized Toolbar in both reports is from the same source - "Custom 1"

What's wrong? Can anyone help? Please.

Dummy99
 
I've encountered situations like this, but I've never known how to fix them. Somehow, Access likes to hang on to old methods that don't exist rather than go by the new ones it's told to use. I don't know how this happens.

Anyway, I usually try deleting and redoing. In this case, delete code related to the reports (esp in Form X) and Exit button, save, then recode. Maybe delete Exit button, save, then re-create. May even take re-creating the reports, but hopefully not. I usually end up reverting to old copies of what I'm editing and adding code again. This is all I can tell you although it probably doesn't help much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top