Check if VBA Code is Disabled

C

Cory

Running Access 2007 on Vista.

I have a database that I'm trying to give some bare bones security to that I
need some help with. I have a table of usernames and passwords and a form for
the users to enter their username and password into. I have the form opened
when the database is opened via the Autoexec macro. The issue is, if the
database gets moved or copied to somewhere that isn't a trusted location,
then the code behind the form won't run and someone could just close the form
and get into the database.

My question is this, is there a way in the Autoexec macro to check if the
VBA code is enabled or if the database is in a trusted locaton? If everything
was normal, the macro could proceed and open the form, otherwise it would
close the database. If this is possible, then the question of what to do if
the Autoexec macro gets disabled... Any suggestions would be greatly
appreciated.

Thanks in advance for any help that you can provide.

-Cory
 
T

Tom van Stiphout

On Fri, 28 Nov 2008 08:01:04 -0800, Cory

CurrentProject.IsTrusted

The Northwind sample database uses this.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top