• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

Access 2007 Form OnLoad event not firing

I have a form with an OnLoad event procedure. The form works correctly in the folder in which the accdb was created, and in some other folders on my hd, but when I copy the accdb to my desktop and to some other folders on my hd the OnLoad procedure does not fire. For testing I inserted MsgBox "Open" as the first line in the procedure and also set a breakpoint on the procedure name line, but the procedure is bypassed entirely in some folders but not in others. I have tried compact/repair and decompile, but neither fixes the problem.

This is an app I intend to distribute to others, so I need to make sure it is going to work everywhere - does anybody have any suggestions?
0
dgmoore1
Asked:
dgmoore1
2 Solutions
 
Dale FyeCommented:
My guess is that these are not "trusted locations", and you will probably see a button similar to that in the attached image on your screen when the form loads.

Access 2007 and 2010 implement trusted publisher and trusted locations as a way to prevent macros and VBA code from firing without users first acknowledging the code.
Access-Security-Warning.jpg
0
 
mbizupCommented:
Have you used set the folders that this DB resides in up as 'trusted locations'?
0
 
dgmoore1Author Commented:
You're both correct - I've been developing in Access since version 1 but for some reason the "Trusted Location" issue keeps slipping my mind. I don't get the "macro nag" on my development workstation, and, come to think of it, this won't be an issue for my users because the security settings on their network force them to enable macros/code each time they open any Access/Excel/whatever application that contains code. The users hate this, but security remains unswayed.  Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now