Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell not working?

Status
Not open for further replies.

moonbase

Programmer
Nov 18, 2002
57
GB
My application is working fine except on some PC's the shell function is not working (returns 0).

Application is 2002 format, Access 2003 loaded on PC.

Applies to mdb and mde version. I have tried stepping through and shelling to various programs such as notepad but no luck. The code is OK because it working elsewhere.

s = Nz(DLookup("strPrmAccess", "tblParam"), "") & " "
s = s & Nz(DLookup("strPrmLetterMDB", "tblParam"), "") & " "
s = s & strParam
Shell s, varWindow

The interesting thing is that automating doesn't wotk on these PC's either although it is fine elsewhere.

Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase Nz(DLookup("strPrmLetterMDB", "tblParam"), "")
appAccess.Visible = True

References look OK.

It is as though there is some security feature or something else stopping Access from running an external routine.

Any help appreciated. Thanks.
 
s = Nz(DLookup("strPrmAccess", "tblParam"), "") & " "
s = s & Nz(DLookup("strPrmLetterMDB", "tblParam"), "") & " "
s = s & strParam
Shell s, varWindow

If you are using the Reddick naming convention, it looks to me like you are putting string variables in quotes. Could that be your problem?

For instance:
Shouldn't
Code:
s = Nz(DLookup("strPrmAccess", "tblParam"), "") & " "

Be
Code:
s = Nz(DLookup(strPrmAccess, "tblParam"), "") & " "
(No quotes around strPrmAccess)
??

--

"If to err is human, then I must be some kind of human!" -Me
 
Sorry if my naming is not clear: strPrmAccess is a field in table, tblParam, so the coding is correct. strPrmAccess actually hold the path and filename of the Access .exe.

The code is working except on certain PC's. I think it's something to do with the way the PC's are set up. Apparently Access 2003 was loaded fresh, not upgraded.

Could it be a memory issue or a security setting?
 
Is the database located on a network share, or is it copied locally to each machine?

--

"If to err is human, then I must be some kind of human!" -Me
 
On the client site where it is not working, both the front end and back end are located on a network share.

On my PC's where it is working, both are held locally.

Thanks
 
It sounds like a network permissions issue, then for the other users. Also, are you sure that it is setup to allow multiple users? An easy test would be to make sure you do not have it open, and attempt to open it from one of the other PCs.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top