Form events

gblack

Registered User.
Local time
Today, 03:55
Joined
Sep 18, 2002
Messages
632
So I have this database that has been passed over to me. It basically opens without the Objects Frame visible. I hit F11 and it shows... I am told there's a main form that kicks off the application.

When I open this form it looks like a gazillion queries kick-off in the background... the problem is that I can't figure out why. The form itself is not bound to any table or query.

I look at the event procedures and there's hardly any code in them.

So I looked up the order of events:
Open → Load → Resize → Activate → Current

And saw that On Open happens first... So, I put some code in the On Open event procedure with a breakpoint right there.

But when I open the form, my breakpoint doesn't break anything... it appears this form has been set to run something prior to the On Open event... is that possible?

If so, how can I find out where it starts and walk through?

Any Ideas would be greatly appreciated.

Thanks,
Gary
 
Last edited:
One thing to look for is a macro named autoexec.
 
Yeah, good thought, but there's no autoexec macro... and the strange thing is that I can open other forms and nothing happens, but this form seems to kick off a bunch of underlying queries that run and run and run (even though it doesn't seem to have any bound table or query itself... Seems to me that if I put a breakpoint on the very first part of the "On Open" event, that should stop everything before it starts... but that just isn't happening... I'm baffled, but that's easily done...

-G
 
Are you sure you are adding Breakpoint on the Form that is set to open first? The other way a Form can be open automatically would be under File-> Options.. Check that too..
 
Yeah, I think I found the issue... there's a bunch of subforms connected to this form and layered ontop of each other... almost like a tab control... so how does the open form event work with multiple subforms? Do all the bound subforms have to make their connections before the On Open event of the main for kicks off? Seems like this is what's happening... the issue is everything runs soooo slowly because there the subforms are bound to queries that are linked to union queries that are linked to other queries that are linked to union queires... like 3 fold. It makes everything run amazingly slowly... Investigating a form that takes 2 minutes to open and then more time than that to kick back to design mode is a painfully slow process...

Anyway... can someone tell me the process as far as opening a form and the queires that run behind? Is there a way to break the connection step and walk through it...?

What I'd like is to open the main form and immediately halt the process, then walk through which subforms make which connections to which queries, one step at a time... please tell me there's some crazy way to do this... :)
 
The subforms load first, yes. Solutions to the situation you describe include either emptying the subforms' sources and only populating them when a subform is being viewed, or use single subform control on the main form and change which form is in it depending on user selections. Either way only one subform at most populates when the form is opened.
 

Users who are viewing this thread

Back
Top Bottom