eval function and command function in access 2007

  • Thread starter Thread starter gsilber
  • Start date Start date
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.
 
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?
 
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
 
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.
 
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.
 
Back
Top