eval function and command function in access 2007

G

gsilber

In previous Access versions i used :
strResult=eval(strTest)
with strTest containing :
instr(command(),"TSE")
since access2007 this doesn't work !
I get error 2425 "Unknown function name"
with tests in debug window i found the issue is in
eval("command()")
The command() function outside eval works but not in an eval string.
 
M

Marshall Barton

gsilber said:
In previous Access versions i used :
strResult=eval(strTest)
with strTest containing :
instr(command(),"TSE")
since access2007 this doesn't work !
I get error 2425 "Unknown function name"
with tests in debug window i found the issue is in
eval("command()")
The command() function outside eval works but not in an eval string.


Post your real code instead of paraphrasing it.

Why do you need to use Eval?
 
D

Dirk Goldgar

gsilber said:
In previous Access versions i used :
strResult=eval(strTest)
with strTest containing :
instr(command(),"TSE")
since access2007 this doesn't work !
I get error 2425 "Unknown function name"
with tests in debug window i found the issue is in
eval("command()")
The command() function outside eval works but not in an eval string.


I suspect this is the result of Jet running in Sandbox mode, since Command
is one of the VBA functions that is blocked by sandbox mode.

This link describes what is blocked by sandbox mode, though the page is
about Access 2003:

This link tells how to control sandbox mode for Access 2007 via the
registry:

http://office.microsoft.com/en-us/access/HA101674291033.aspx
 
G

gsilber

Marshall Barton said:
Post your real code instead of paraphrasing it.

Why do you need to use Eval?
Thanks for this answer. but i will not go on ... next post from Dirk Goldgar
give me the solution.
 
G

gsilber

Dirk Goldgar said:
I suspect this is the result of Jet running in Sandbox mode, since Command
is one of the VBA functions that is blocked by sandbox mode.

This link describes what is blocked by sandbox mode, though the page is
about Access 2003:

This link tells how to control sandbox mode for Access 2007 via the
registry:

http://office.microsoft.com/en-us/access/HA101674291033.aspx

Thank you! After changing the sandbox value from 3 to 2 in the registry, as
explained in the above link the command function into the eval string works
fine.
 

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