Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

SHELL handling a switch.....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason - 07 Dec 2005 09:48 GMT
I have the following event proceedure on a command button - which works
great, however, i would like to add the value of another field onto the
end.

e.g i have a field with the computer name in, and i would like the
program to execute with the computer name on the end of the command,
but not sure how to go about this....
something like:
stAppName = "C:\Program Files\Real\VNC4\vncviewer.exe"
computername.Value

any help is appreciated

--------------------------------------------------------------------------------------------------------------------------
Private Sub VNC_Viewer_Click()
On Error GoTo Err_VNC_Viewer_Click

   Dim stAppName As String

   stAppName = "C:\Program Files\RealVNC\VNC4\vncviewer.exe"
   Call Shell(stAppName, 1)

Exit_VNC_Viewer_Click:
   Exit Sub

Err_VNC_Viewer_Click:
   MsgBox Err.Description
   Resume Exit_VNC_Viewer_Click
   
End Sub
Terry Kreft - 07 Dec 2005 11:07 GMT
either
stAppName = """" & "C:\Program Files\Real\VNC4\vncviewer.exe" & """" &
computername.Value
or
stAppName = """C:\Program Files\Real\VNC4\vncviewer.exe""" &
computername.Value

call Shell(stappname)

Signature

Terry Kreft

>I have the following event proceedure on a command button - which works
> great, however, i would like to add the value of another field onto the
[quoted text clipped - 26 lines]
>
> End Sub
Jason - 07 Dec 2005 13:02 GMT
Thanks very much for that - worked a treat.

thanks for the help
Jason
Tom van Stiphout - 07 Dec 2005 14:11 GMT
The reason Terry's code works is because you have to put double-quotes
around a path that includes funny characters or spaces.
If you had typed your original value in the Run box in Windows, it
wouldn't have worked either: Windows would have thought you wanted to
run a program called:
C:\Program
and pass it a couple of arguments like this:
Files\Real\VNC4\vncviewer.exe
and
<SomeComputerName>

-Tom.

>either
>stAppName = """" & "C:\Program Files\Real\VNC4\vncviewer.exe" & """" &
[quoted text clipped - 4 lines]
>
>call Shell(stappname)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.