expressions blocked inconsistently

R

Raydar

An Access 2003 database I've been creating suffers from blocked expressions,
but differently on different machines that have the same Macro Security
settings.

On most of the machines I've tried, at work, home, & friends' homes--all
running Office 2003 in WinXP or Win7b--I get unpopulated form fields &
various error
boxes when fields are referenced in my VBA code, UNLESS Macro Security is
set to "Low." But on my main work computer, I can leave Macro Security set to
"Medium" and the expressions which are blocked on all the other machines
(when their Macro Security is set to "Medium") are NOT blocked.

One MS Access help document says expression blocking can be gotten around by
using the expressions in VBA instead of in regular Access design-view
elements;
but I've done that in all seemingly relevant places, and put "Public" in
every single VBA procedure declaration, and I still get errors that seem to
owe to
expression blocking unless I set Macro Security to "Low," again with the
strange exception of my main work computer.

My questions, if any kind soul can answer:

(1) What could be responsible for my needing to set Macro Security to "Low,"
in order for expressions not to be blocked, on most but not all machines?

(2) What else can I try to defeat expression blocking, besides putting all
relevant expressions in VBA and making all function/subroutine declarations
public?

Thanks very much for any help!
 
C

Chris O'C via AccessMonster.com

1 - Some pcs have sandbox mode set to 2, others have changed the default to
something else. Check the registry:

\\HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\SandboxMode

2 - When changing from medium to low macro security, a prompt asks "Unsafe
expressions are blocked....Do you want to allow the evaluation of potentially
unsafe expressions to be evaluated?" When changing from low to medium, a
prompt asks "Do you want to block unsafe expressions?"

Slap every user who clicks "Yes" and say "That's why my app's expressions are
blocked on your pc". If that doesn't work, take away their mice.

Chris
 
R

Raydar

Thanks, Chris

I may need to slap myself to get reality back: I did find that registry
sandbox setting at 2 on the machines that were refusing to let my expressions
work, but when I checked the machine that has never given me trouble with
them, its registry sandbox setting was 3.

Because there'll be no more than 10 - 15 users at maximum, it's probably not
going to be a big deal to get everyone to set Access' macro security to low
or even set their registry sandbox values to 0. I just wish I could achieve
what Access' help dox mention, namely being able to get around sandbox mode
by putting my code in the right places.

Also, on the machines that were blocking my expressions, when I set their
registry sandbox values to 0, Access overrode that setting according to the
Macro Security setting within Access. Gol-darnit. :)
 
R

Raydar

Thanks, Gina

Yes, all the machines in question have Jet 4.0--or at least the registry
lists Jet 4.0.

I tried changing the registry's default sandbox mode value per Chris O'C's
reply (see above--and oops, I replied to my own message instead of his;
darn!), so what I say there may help you tell what's going on.

Since Access' help dox indicate that using VBA gets one around the sandbox
barrier, I'd love it if there were an efficient way to determine precisely
what expression is the problem . . . 'cause as far as I know, I've used VBA
for everything relevant.
 
C

Chris O'C via AccessMonster.com

When sandbox mode is 0, it's disabled for all Office apps, not just Access.
If you keep it on 2, it's disabled for Access but enabled for the targets of
most macro viruses: Word and Excel.

I'd recommend you keep sandbox mode on 2 so it doesn't interfere with your
Access app, but protects you from harmful macros in your other Office apps.

"Also, on the machines that were blocking my expressions, when I set their
registry sandbox values to 0, Access overrode that setting according to the
Macro Security setting within Access."

The macro security level doesn't change or override your sandbox mode. The
things that are affecting your sandbox mode registry setting are:

1 - group policy settings from the network admin (they can override your
settings - you'll know because your changes won't save).
2 - clicking on the yes or no button when asked if you want to block unsafe
expressions.
3 - your manual changes to the registry for sandbox mode.

Chris
 
R

Raydar

Thanks, Chris--the group policy factor might just be the thing responsible
for the seemingly inconsistent behavior.
 

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