Originally Posted by
Seamus59
...On a previous job it works pefectly, but in my current project it does not...
...the buttons don't work unless I change from form view into either Layout or Design, then change back to Form View, then they work ...
From v2007 forward Access files need to be in a Folder that has been declared as 'Trusted.' If this hasn't been done, code will run when going from Design View to Form View, but not when the Form is independently opened in Form View. Perhaps this was done in your previous project but not in this one?
To "Trust" your folder, click:
- Office Button (top left)
- Access Options (bottom of dialog)
- Trust Center (left)
- Trust Center Settings (button)
- Trusted Locations (left)
- Add new location (button)
The code works, when going from Design View to Form View, because the Access security is only invoked when opening the Form directly, i.e. clicking on the Form in the Navigation Pane.
Like June7, I'm curious/concerned about your statement "I have a form I create programatically." This type of thing is usually a very bad idea.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007