AUTOEXEX Macro - Check OS or Access Version BEFORE Enable MACRO Security

Joined
Jul 11, 2013
Messages
2
Reaction score
0
We have users on both ACCESS 2003/XP and ACCESS 2010/Win7. The database is ACCESS 2003 format.

For the Access2010/Win7 users we want to use the [currentproject].[istrusted] to determine whether or not to show a form to ENABLE MACRO on the Security Bar. Our laptop security makes that happen each time a Access2010/Win7 user opens up the database, and we want to keep it that way. The .istrusted works great.

For the Access2003/XP users .istrusted doesn't work so the AUTOEXEC fails on the .istrusted line. ON ERROR isn't in Access 2003, so we can't use that.

We do a GetAccessVersion() function in VBA and if it equals 11 we know that your an Access2003 user so we run the login() and stopmacro and skip the .istrusted CONDITIONS which works fine.

But, for the ACCESS 2010 users, the GetAccessVersion() in VBA won't execute until AFTER they pick the ENABLE MACRO button and that's to late... Never gets to the .istrusted steps to display the form.

I've tried the DIR function and check for OFFICE14 folder, assuming if OFFICE 14 folder is there you're running Access 2010, works great in Access 2003, doesn't work in Access 2010.

I need a CONDITION in the Autoexec MACRO that I can test to determine if I'm Win7 or XP or Access 2003 or Access 2010 that WORKS IN BOTH ACCESS 2003 and 2010. Either operating system or database version works here because all XP users have Access 2003, and all Win7 users have Access 2010.

I tried to used filesystemobject in the CONDITION line, syscmd(acSysCmdAccessVer)=11 too. Didn't understand the syntax of the filesystermobject, and the syscmd worked great in Access 2003 but not in Access 2010.

Am I missing a Access Reference Library?

Can't believe we're the only ones having this issue, users on both versions of Access. WOULD TRULY appreciate any help. I hope I've been clear.

The CONDITION statement in the AUTOEXEC macro has to work for ACCESS 2003 and 2010 and BEFORE the user selects ENABLE MACRO on the security bar in Access 2010. PLEASE!

Corporate IT has decided there will be NO trusted locations...Getting the ENABLE MACRO security bar is no problem...users don't seem to mind... but the .istrusted doesn't work for the Access 2003 users and Access 2003 DB format doesn't have ON ERROR for macros yet. No clue how to test for a system folder or get the OS version or Database version without running vba and that will work on the CONDITION line of the AUTOEXEC Macro before the ENABLE macro is selected huh?
 

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