How to force user to enable vba macro?

daze

Registered User.
Local time
Today, 02:43
Joined
Aug 5, 2009
Messages
61
So, I need to make sure that there is NO SECURITY WARNING message when opening my database in Access 2007, because I have some procedures than will not function otherwise.

I googled it but I was only able to find VBA code for Excel 2007.

Any clue here?
 
Looks like it is, just I have no clue how to implement this...
 
anyway

do you mean the warnings on opening a dbs

one way of turning off the warnings

from the access menu

tools
macro
security
low

(this is A2003 - there must be something similar in A2007)

========
otherwise, for individual dbs's set trusted publishers.
 
another thought

just put a do-nothing sub in a module

in your startup form, try to use this sub in the open event.

if it errors - tell the user he MUST enable the macros, and quit.


[hmmm - although maybe it wont run this code even, if macros are disabled - I just dont know!]
 
I got it!

This refers to Access 2007.

I've made a form with warnings that macros are disabled and that they need to be enabled in order to continue forward.

I've also made macro with autoexec name. In it I have put:

condition [CurrentProject].[IsTrusted]=False --> action OpenForm --> arguments the form with warnings
- if macros are disabled open only form with warnings and how to enabe them

condition [CurrentProject].[IsTrusted]=True --> action OpenForm --> arguments startup form (form that you want to be opened first)
- if macros are enabled open form that you want to be the default one

I haven't also seleced any form as default form in Access options (this way it doesn't open startup form if macros are disabled)
 

Users who are viewing this thread

Back
Top Bottom