The Missing Macro and the sorry tale of Unhelpful Help (1 Viewer)

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
Hi Folks,
I have been playing around and have deleted a subform and replaced it with another. Each time I now open the parent form I get an error message referencing the old subform and telling me to 'Open the Macro window...'

Unfortunately I cant find out how to do this. I also have a few orphaned objects that Access complains about but doesn't offer any suggestions on where they're hiding. Ideas?

Thanks.
 

tvanstiphout

Active member
Local time
Today, 04:58
Joined
Jan 22, 2016
Messages
222
Please quote any error messages VERBATIM, and/or add a screenshot.

Why not name the replacement subform the same as the original?
 

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
1703166294521.png


The name is not the same as this is a learning exercise and I'm trying out ideas. I hade assumed that I had removed all references when I deleted the old one but I have missed something that's hiding somewhere and the software isn't helping!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:58
Joined
Oct 29, 2018
Messages
21,473
Are you using macros or VBA?
 

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
Hi DBguy,

Intentionally, neither! I was just using the design view to edit an existing form. Whatever Access uses as default to process the forms is what's being used.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:58
Joined
Oct 29, 2018
Messages
21,473
Hi DBguy,

Intentionally, neither! I was just using the design view to edit an existing form. Whatever Access uses as default to process the forms is what's being used.
I asked because I was going to recommend you do a search. So, do you know what is your Access install is using as a default? It's easier to do a search in VBA than in macros, just FYI.
 

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
Hi DBguy,

Thanks. Searching seems to be something Access doesn't seem to be very keen on. My experience so far is akin to wading through treacle.
 

bob fitz

AWF VIP
Local time
Today, 12:58
Joined
May 23, 2011
Messages
4,727
View attachment 111538

The name is not the same as this is a learning exercise and I'm trying out ideas. I hade assumed that I had removed all references when I deleted the old one but I have missed something that's hiding somewhere and the software isn't helping!
Have you checked the "Name" property setting and the "Source Object" property setting of the control being used to hold the subform.
 

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
Hi Bob,

That's basically what I'm trying to establish, what is the 'control being used to hold the subform' I had intentionally deleted an old sub form but something somewhere is still hankering after the old days and just wont let go! I just cant find where it is or any way of searching for it.
 

bob fitz

AWF VIP
Local time
Today, 12:58
Joined
May 23, 2011
Messages
4,727
Hi Bob,

That's basically what I'm trying to establish, what is the 'control being used to hold the subform' I had intentionally deleted an old sub form but something somewhere is still hankering after the old days and just wont let go! I just cant find where it is or any way of searching for it.
So, I repeat, have you checked the "Name" property setting and the "Source Object" property setting of the control being used to hold the subform.

The "Name" property setting can be found on the tab called "Other" on the Property Sheet and the "Source Object" property setting can be found on the tab called "Data" on the Property Sheet.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:58
Joined
Feb 28, 2001
Messages
27,186
The "orphaned" objects will take a text search. All VBA can be searched at one time using the "Project" option for the scope of the search. Unfortunately, a missing macro will be harder to find.

Typically when you create event code, you get a choice of whether to create VBA code or enter the name of a macro. Here is the tedious little pain in the toches - to find an event macro case, you must open every form in design mode, one at a time of course, and visually inspect the form's Properties >> Events panel to find an event slot that neither claims to be blank nor "=function(parameters)" nor does it contain "[event procedure]" as its content. By process of elimination, such event slots refer to macro names. If you have "[event procedure]" or a function call (the "=func()" syntax), the code in either of those should be searchable when you search the VBA as noted in the first paragraph. If you find an event macro name, you can verify that you actually have a macro with that name.

As to the report you can't find, macros are hard to search because they are stored differently than VBA (i.e. as searchable text). But if you have a sub-form control, the name of its associated form is a property of the control. You should be able to search your forms for sub-form controls and examine properties thereof. The referenced form will be in the sub-form's .SourceObject property.

EDIT: I see that Bob Fitz beat me to naming where to look on the sub-form control.
 

Gary Williams

New member
Local time
Today, 12:58
Joined
Dec 18, 2023
Messages
7
Hi Folks,

Thanks. In the end I reverted to an earlier version. I think I looked where Bob suggested but I have no idea what 'control' was the relevant one as there shouldn't have been any holding the sub form as it had been deleted. Basically the question could have been, 'I have deleted the control, why is it still looking for the sub form?'
 

Minty

AWF VIP
Local time
Today, 12:58
Joined
Jul 26, 2013
Messages
10,371
Probably something on the main form is trying to reference the sub form, or even a query might be.
 

Users who are viewing this thread

Top Bottom