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

Form_Load not triggered when form loads

Status
Not open for further replies.

SABS

Programmer
Nov 21, 2003
14
CA
Hi all,

I'm working with ACCESS 2002 on Windows 2000.

I have a form with a number of sub-forms on it. Everything seemed to be working fine, but for some reason now the Form_Load event is not triggered when the form loads, but it IS triggered when the form is unloaded.

Possible changes to the environment are:
1. Reinstalled Access in order to install the Security Wizard.
2. Played around with security and somehow lost the System.MDW file. Found a copy on a network drive and copied it into the C:\ProgramFiles\Common Files\System directory.

I can't think of anything else that might have triggered this problem.

Anyone have any ideas? Thanks in advance.
 
Have you tried running MSACCESS.EXE via the command line with the decompile switch and opened your database?

MSACCESS.EXE /decomile "C:\Example\ProblemDatabase.mdb
 
Just tried it and no luck. Thanks anyway.

It seems that the Form_Load event is fired when I actively (i.e. not programmatically) click on a control on the form, but not before. Hmmmm...
 
It sounds like the code is firing on the activate event instead of the load event... Are you sure your procedure is named properly?
 
The procedure's standard. The same code does fire the Form_Load event on a different computer. I found an old posting on another site that described a similar problem (although the solution wasn't helpful in my case - in that case it was an unregistered ocx).

I'm suspicious that it has something to do with the registry, seeing as it seemed to occur after I did change to my Office install.

 
Finally the bell in my head went off...

I bet the references set on the computer has changed.

Open any module on the system that works in design view. Go to the tools menu and references. Look at all the checked references and their order. Next make the broken system look like that.

That's my best guess.
 
Just a thought regarding the fact that the Load event does not occur when the form has no data to show.. Does your form have data to display?!?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top