Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Tue, 29 Apr 2008 11:27:33 -0500,    group: microsoft.public.access.dataaccess.pages        back       


OnClick Help   
Can anyone please tell me how to set up a command button on a data page to 
open pdf in file to match what is listed in a field?
Pam
date: Tue, 29 Apr 2008 11:27:33 -0500   author:   Pam

Re: OnClick Help   
Create your command button, lets assume its name is btnPDF
then in the script editor you should have something like this for the 
onclick event
<script language=vbscript for=btnPDF event=onclick
 <!--
 dim objShell
 dim myFile
 set objShell = CreateObject("Shell.Application")
 myFile = yourfield.value 'yourfield value must be a full path and valid 
filename
 objShell.ShellExecute myFile, "", "", "open", 1
 set objShell = Nothing
 -->
</script>

Paul D

"Pam"  wrote in message 
news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
: Can anyone please tell me how to set up a command button on a data page to
: open pdf in file to match what is listed in a field?
: Pam
:
:
date: Wed, 30 Apr 2008 14:15:55 -0400   author:   PaulD nospam

Re: OnClick Help   
Paul D,

Thank you so much for your reply.  I entered the code as you have it, 
substituting yourfield.value for ItemNumber.value and received the following 
error:

An error has occurred in the script on this page.
Line 181
Char: 1
Error: permission denied
Code: 0

When I go to line 181, it is this line "objShell.ShellExecute myFile, "", 
"", "open", 1"

Do you know what the problem could be?

I have worked on trying to set up a command button or at least an 
alternative for quite some time and believe this is the only thing holding up 
posting dap for other users.  Your time and help are greatly appreciated.
Thank you again,
Pam


"PaulD" wrote:

> Create your command button, lets assume its name is btnPDF
> then in the script editor you should have something like this for the 
> onclick event
> <script language=vbscript for=btnPDF event=onclick
>  <!--
>  dim objShell
>  dim myFile
>  set objShell = CreateObject("Shell.Application")
>  myFile = yourfield.value 'yourfield value must be a full path and valid 
> filename
>  objShell.ShellExecute myFile, "", "", "open", 1
>  set objShell = Nothing
>  -->
> </script>
> 
> Paul D
> 
> "Pam"  wrote in message 
> news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
> : Can anyone please tell me how to set up a command button on a data page to
> : open pdf in file to match what is listed in a field?
> : Pam
> :
> : 
> 
> 
>
date: Tue, 6 May 2008 11:50:02 -0700   author:   PHisaw

Re: OnClick Help   
I'm not sure exactly what could be the issue but here is a suggestions to 
try.
When I tested this, I copied a pdf file I had to my C drive.  My test code 
had
myFile = "C:\test.pdf"
With the line above, when I ran the script it opened the file using Adobe 
reader (the default app associated with .pdf files)
I would suggest you try something similar and see if it works and post back.
Paul D

"PHisaw"  wrote in message 
news:C1F11075-AB74-4E37-9935-C0A8A873D348@microsoft.com...
: Paul D,
:
: Thank you so much for your reply.  I entered the code as you have it,
: substituting yourfield.value for ItemNumber.value and received the 
following
: error:
:
: An error has occurred in the script on this page.
: Line 181
: Char: 1
: Error: permission denied
: Code: 0
:
: When I go to line 181, it is this line "objShell.ShellExecute myFile, "",
: "", "open", 1"
:
: Do you know what the problem could be?
:
: I have worked on trying to set up a command button or at least an
: alternative for quite some time and believe this is the only thing holding 
up
: posting dap for other users.  Your time and help are greatly appreciated.
: Thank you again,
: Pam
:
:
: "PaulD" wrote:
:
: > Create your command button, lets assume its name is btnPDF
: > then in the script editor you should have something like this for the
: > onclick event
: > <script language=vbscript for=btnPDF event=onclick
: >  <!--
: >  dim objShell
: >  dim myFile
: >  set objShell = CreateObject("Shell.Application")
: >  myFile = yourfield.value 'yourfield value must be a full path and valid
: > filename
: >  objShell.ShellExecute myFile, "", "", "open", 1
: >  set objShell = Nothing
: >  -->
: > </script>
: >
: > Paul D
: >
: > "Pam"  wrote in message
: > news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
: > : Can anyone please tell me how to set up a command button on a data 
page to
: > : open pdf in file to match what is listed in a field?
: > : Pam
: > :
: > :
: >
: >
: >
date: Wed, 7 May 2008 10:45:08 -0400   author:   PaulD nospam

Re: OnClick Help   
Paul,

I changed the line "myFile = fieldname.value to myFile = "c:\bjm.pdf"
and I still get error msg "permission denied".  Do you have any other 
suggestions?

Thanks,
Pam

"PaulD" wrote:

> I'm not sure exactly what could be the issue but here is a suggestions to 
> try.
> When I tested this, I copied a pdf file I had to my C drive.  My test code 
> had
> myFile = "C:\test.pdf"
> With the line above, when I ran the script it opened the file using Adobe 
> reader (the default app associated with .pdf files)
> I would suggest you try something similar and see if it works and post back.
> Paul D
> 
> "PHisaw"  wrote in message 
> news:C1F11075-AB74-4E37-9935-C0A8A873D348@microsoft.com...
> : Paul D,
> :
> : Thank you so much for your reply.  I entered the code as you have it,
> : substituting yourfield.value for ItemNumber.value and received the 
> following
> : error:
> :
> : An error has occurred in the script on this page.
> : Line 181
> : Char: 1
> : Error: permission denied
> : Code: 0
> :
> : When I go to line 181, it is this line "objShell.ShellExecute myFile, "",
> : "", "open", 1"
> :
> : Do you know what the problem could be?
> :
> : I have worked on trying to set up a command button or at least an
> : alternative for quite some time and believe this is the only thing holding 
> up
> : posting dap for other users.  Your time and help are greatly appreciated.
> : Thank you again,
> : Pam
> :
> :
> : "PaulD" wrote:
> :
> : > Create your command button, lets assume its name is btnPDF
> : > then in the script editor you should have something like this for the
> : > onclick event
> : > <script language=vbscript for=btnPDF event=onclick
> : >  <!--
> : >  dim objShell
> : >  dim myFile
> : >  set objShell = CreateObject("Shell.Application")
> : >  myFile = yourfield.value 'yourfield value must be a full path and valid
> : > filename
> : >  objShell.ShellExecute myFile, "", "", "open", 1
> : >  set objShell = Nothing
> : >  -->
> : > </script>
> : >
> : > Paul D
> : >
> : > "Pam"  wrote in message
> : > news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
> : > : Can anyone please tell me how to set up a command button on a data 
> page to
> : > : open pdf in file to match what is listed in a field?
> : > : Pam
> : > :
> : > :
> : >
> : >
> : > 
> 
> 
>
date: Wed, 7 May 2008 09:05:01 -0700   author:   PHisaw

Re: OnClick Help   
It appears permission denied is due to a security setting in Internet 
Explorer.  I have all my DAPs on a local server and have added that server 
to a trusted zone so I am able to use shellexecute.  If your DAPs are in the 
default level security, then shellexecute is not allowed.  Check out the 
link below for a bit more information

http://www.eggheadcafe.com/forumarchives/scriptingVisualBasicscript/Sep2005/post23662194.asp

Paul D

"PHisaw"  wrote in message 
news:2A365CF4-8040-4206-9CD0-E7EAF34949F7@microsoft.com...
: Paul,
:
: I changed the line "myFile = fieldname.value to myFile = "c:\bjm.pdf"
: and I still get error msg "permission denied".  Do you have any other
: suggestions?
:
: Thanks,
: Pam
:
: "PaulD" wrote:
:
: > I'm not sure exactly what could be the issue but here is a suggestions 
to
: > try.
: > When I tested this, I copied a pdf file I had to my C drive.  My test 
code
: > had
: > myFile = "C:\test.pdf"
: > With the line above, when I ran the script it opened the file using 
Adobe
: > reader (the default app associated with .pdf files)
: > I would suggest you try something similar and see if it works and post 
back.
: > Paul D
: >
: > "PHisaw"  wrote in message
: > news:C1F11075-AB74-4E37-9935-C0A8A873D348@microsoft.com...
: > : Paul D,
: > :
: > : Thank you so much for your reply.  I entered the code as you have it,
: > : substituting yourfield.value for ItemNumber.value and received the
: > following
: > : error:
: > :
: > : An error has occurred in the script on this page.
: > : Line 181
: > : Char: 1
: > : Error: permission denied
: > : Code: 0
: > :
: > : When I go to line 181, it is this line "objShell.ShellExecute myFile, 
"",
: > : "", "open", 1"
: > :
: > : Do you know what the problem could be?
: > :
: > : I have worked on trying to set up a command button or at least an
: > : alternative for quite some time and believe this is the only thing 
holding
: > up
: > : posting dap for other users.  Your time and help are greatly 
appreciated.
: > : Thank you again,
: > : Pam
: > :
: > :
: > : "PaulD" wrote:
: > :
: > : > Create your command button, lets assume its name is btnPDF
: > : > then in the script editor you should have something like this for 
the
: > : > onclick event
: > : > <script language=vbscript for=btnPDF event=onclick
: > : >  <!--
: > : >  dim objShell
: > : >  dim myFile
: > : >  set objShell = CreateObject("Shell.Application")
: > : >  myFile = yourfield.value 'yourfield value must be a full path and 
valid
: > : > filename
: > : >  objShell.ShellExecute myFile, "", "", "open", 1
: > : >  set objShell = Nothing
: > : >  -->
: > : > </script>
: > : >
: > : > Paul D
: > : >
: > : > "Pam"  wrote in message
: > : > news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
: > : > : Can anyone please tell me how to set up a command button on a data
: > page to
: > : > : open pdf in file to match what is listed in a field?
: > : > : Pam
: > : > :
: > : > :
: > : >
: > : >
: > : >
: >
: >
: >
date: Wed, 7 May 2008 17:18:13 -0400   author:   PaulD nospam

Re: OnClick Help   
Thanks, Paul, for your time and help.  I looked at the link and did some more 
research, but still have errors.  Will try something at a later date.

Thanks again,

Pam

"PaulD" wrote:

> It appears permission denied is due to a security setting in Internet 
> Explorer.  I have all my DAPs on a local server and have added that server 
> to a trusted zone so I am able to use shellexecute.  If your DAPs are in the 
> default level security, then shellexecute is not allowed.  Check out the 
> link below for a bit more information
> 
> http://www.eggheadcafe.com/forumarchives/scriptingVisualBasicscript/Sep2005/post23662194.asp
> 
> Paul D
> 
> "PHisaw"  wrote in message 
> news:2A365CF4-8040-4206-9CD0-E7EAF34949F7@microsoft.com...
> : Paul,
> :
> : I changed the line "myFile = fieldname.value to myFile = "c:\bjm.pdf"
> : and I still get error msg "permission denied".  Do you have any other
> : suggestions?
> :
> : Thanks,
> : Pam
> :
> : "PaulD" wrote:
> :
> : > I'm not sure exactly what could be the issue but here is a suggestions 
> to
> : > try.
> : > When I tested this, I copied a pdf file I had to my C drive.  My test 
> code
> : > had
> : > myFile = "C:\test.pdf"
> : > With the line above, when I ran the script it opened the file using 
> Adobe
> : > reader (the default app associated with .pdf files)
> : > I would suggest you try something similar and see if it works and post 
> back.
> : > Paul D
> : >
> : > "PHisaw"  wrote in message
> : > news:C1F11075-AB74-4E37-9935-C0A8A873D348@microsoft.com...
> : > : Paul D,
> : > :
> : > : Thank you so much for your reply.  I entered the code as you have it,
> : > : substituting yourfield.value for ItemNumber.value and received the
> : > following
> : > : error:
> : > :
> : > : An error has occurred in the script on this page.
> : > : Line 181
> : > : Char: 1
> : > : Error: permission denied
> : > : Code: 0
> : > :
> : > : When I go to line 181, it is this line "objShell.ShellExecute myFile, 
> "",
> : > : "", "open", 1"
> : > :
> : > : Do you know what the problem could be?
> : > :
> : > : I have worked on trying to set up a command button or at least an
> : > : alternative for quite some time and believe this is the only thing 
> holding
> : > up
> : > : posting dap for other users.  Your time and help are greatly 
> appreciated.
> : > : Thank you again,
> : > : Pam
> : > :
> : > :
> : > : "PaulD" wrote:
> : > :
> : > : > Create your command button, lets assume its name is btnPDF
> : > : > then in the script editor you should have something like this for 
> the
> : > : > onclick event
> : > : > <script language=vbscript for=btnPDF event=onclick
> : > : >  <!--
> : > : >  dim objShell
> : > : >  dim myFile
> : > : >  set objShell = CreateObject("Shell.Application")
> : > : >  myFile = yourfield.value 'yourfield value must be a full path and 
> valid
> : > : > filename
> : > : >  objShell.ShellExecute myFile, "", "", "open", 1
> : > : >  set objShell = Nothing
> : > : >  -->
> : > : > </script>
> : > : >
> : > : > Paul D
> : > : >
> : > : > "Pam"  wrote in message
> : > : > news:O6cyvThqIHA.4476@TK2MSFTNGP06.phx.gbl...
> : > : > : Can anyone please tell me how to set up a command button on a data
> : > page to
> : > : > : open pdf in file to match what is listed in a field?
> : > : > : Pam
> : > : > :
> : > : > :
> : > : >
> : > : >
> : > : >
> : >
> : >
> : > 
> 
> 
>
date: Thu, 8 May 2008 11:35:04 -0700   author:   PHisaw

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us