Solved Determine What Code Is Still Running?

Thanks, I think I muddied the waters a bit in post-01 with talk of user-declared events. Been using Access' standard events for sometime & fine with them. I am referring to user-declared classes & class-instantiations handling events raised from other classes...

In Nr-12 commenting out all code in the problematic sub-form & reopening the db - this should have eradicated the problem completely. But it did not. This can only be bug/ unintended memory retention. There were no procedures unterminated at this point & the problem has been traced to the specific sub-form. Removing all code should have fixed this but it did not. Maybe restarting the computer has completely flushed the memory.



Thanks @sonic8 , I think you solved it:
  • Yes there are open user-declared class instantiations open. So if an open class instantiation generates this prompt then that is the thread solved.
    • Tested by creating a new self-terminating class. No prompt generated when creating a new sub. Repeated the exercise, set properties to the class; assigned values to the properties; did not terminate the class - PROMPT GENERATED (confirming @sonic8 's logic).

The Counter Argument
BUT Access has it's own class instantiations open all the time (forms, queries, controls/ sub-controls...) & never throws the prompt when a new sub is being created.

But the forms opened by access will (should) work correctly as supplied, and will never cause a debug error.
The prompt you are seeing must be caused because whatever you are trying to do is not compatible with currently running code.
You won't see that by editing code while the database is not running.

What is making you enter the code with the debugger? Are you seeing an error and trying to deal with it.

As an example, I have developed some code to amend modules. You can for instance iterate the modules, and add code to a module, or all modules. If I want to add code to me On Load routine I can do that.

Running this code does edit the modules correctly, but also silently stops the current database running. You don't see the message you are seeing, but the project does get reset. I think it's easy to understand why this would be outside the editor's ability to keep track of the project code. Making changes one at a time may or may not need the project to reset.
 
What is making you enter the code with the debugger? Are you seeing an error and trying to deal with it.

As an example, I have developed some code to amend modules. You can for instance iterate the modules, and add code to a module, or all modules. If I want to add code to me On Load routine I can do that...

Thanks, sorry I did not clarify in the OP I was talking handling user-declared bespoke Events with the Event-Handlers in different classes (not a basic Form Event like current) & we're a bit beyond instructions on how to set a breakpoint.
The reference to Access objects was a very basic e.g. to see if the same polymorphism applied & I shouldn't have mentioned anything about event listeners as I was pretty positive this was not the case.

If I'm reading @sonic8 & @NauticalGent correctly (& I've tested this with a very basic class instantiation & it certainly seems the case) - it seems that Access protects an open instance of a user's class with this prompt. Much like in a more basic e.g. an incomplete/ suspended call between procedures. To clarify again, all calls & procedures have terminated successfully. It is the open user-class instantiation being protected which causes this prompt & it makes sense to me now.
It also now makes sense that Access does not do it for it's own objects - because Access is aware of all it's own objects & likely has these logic-patterns accounted for. BUT not for user objects (for obvious reason they can create an infinite amount/ types to which it could never account for).
 
Last edited:
Thanks, sorry I did not clarify in the OP I was talking handling user-declared bespoke Events with the Event-Handlers in different classes (not a basic Form Event like current) & we're a bit beyond instructions on how to set a breakpoint.
The reference to Access objects was a very basic e.g. to see if the same polymorphism applied & I shouldn't have mentioned anything about event listeners as I was pretty positive this was not the case.

If I'm reading @sonic8 & @NauticalGent correctly - it seems that Access protects an open instance of a user's class with this prompt. Much like in a more basic e.g. an incomplete/ suspended call between procedures. To clarify again, all calls & procedures have terminated successfully. It is the open user-class instantiation being protected which causes this prompt & it makes sense to me now.
It also now makes sense that Access does not do it for it's own objects - because Access is aware of all it's own objects & likely has these logic-patterns accounted for. BUT not for user objects (for obvious reason they can create an infinite amount/ types to which it could never account for).

I don't quite understand. Do you mean there is no active event, but the program is still running and waiting for an event/interruption, (ie there is an open form) and therefore still won't allow certain code to be changed. The user would actually have to reset the program in order to make code changes. Is that possible?

Is there a difference between a program running but dormant compared with a program not actually running at all. Is that a philosophical/metaphysical distinction.
 
I don't quite understand. Do you mean there is no active event, but the program is still running and waiting for an event/interruption, (i.e. there is an open form) and therefore still won't allow certain code to be changed. The user would actually have to reset the program in order to make code changes. Is that possible?

In this case it was not about events, or forms. It was that Access protects wiping out user class-instantiation unnecessarily with this prompt; which is the same prompt as provided when code has not fully completed between called procedures.
You're getting a little hung-up on standard Access events "do you mean there is no active event". Forget events here; it's not about events. I failed to mention in my OP that I was handling user-declared events in different classes (more advanced than Access' standard event handling). That is why I was concerned with events & thought I may have had a logic-route unaccounted for; but that was not the case & I failed to mention this in the OP as I thought I would needlessly overcomplicate the issue.

Is there a difference between a program running but dormant compared with a program not actually running at all. Is that a philosophical/metaphysical distinction.

I fail to see a philosophical/ metaphysical as contrastingly opposite in the context of this post - VBA is an interpreted language, not a compiled language & I'm getting off-topic here. An app can be considered 'dormant' to what command has just been run (STOP for e.g.) or what variables/ procedures are available to it at that moment in time. That is the entire premise of programming.
 
Last edited:
So there's an active structure in memory that would be de deleted/released by resetting the program.

Wouldn't you get the same if you created a pointer to a remote table to maintain a permanent connection to the data. That would also be deleted on resetting the program, wouldn't it?
 
So there's an active structure in memory that would be de deleted/released by resetting the program.

Of course, this is what RAM (Random Access Memory) is, & goes without saying for every application ever written.

Wouldn't you get the same if you created a pointer to a remote table to maintain a permanent connection to the data. That would also be deleted on resetting the program, wouldn't it?

:ROFLMAO: :ROFLMAO: You're comparing apples with oranges, complete different topic in itself which results would be subject to how they were implemented. This thread's solution was made by sonic & nauticalgent (thanks guys) & regurgitated by me in #22 & 24.
 
Last edited:
This thread's solution was made by sonic & nauticalgent
Just to be clear, Philipp (Sonic8) is the one who provided assurance, I just gave it a thumbs up because I get the message frequently in my app due to timers on hidden forms and I realised it was normal.

To group me with Sonic8 is an honor and a privilege I have not earned...yet!
 

Users who are viewing this thread

Back
Top Bottom