P
pfm721
I am adapting some code that will open an outside program when a command
button is pushed. I have sucessfully merged the code into my database. The
button works when I am using it on my computer but I get a path not found
when running it on another computer in the office. If someone could help me
figure out why this is happening I would greatly appreciate it.
The code is as follows.
Private Sub cmdOpenVista_Click()
VistaOpen "~^FEE PATIENT INQUIRY - LOC", Nz(VetSSN, "")
End Sub
Here is the code for the sub routine.
Sub VistaOpen(MenuString As String, SSN As String)
Dim OutputFileName As String
Dim fs, File As Object
If IsBlank(MenuString) Then
Call Shell("C:\Program Files\Esker\SmarTerm\STOFFICE.exe """ &
"C:\Documents and Settings\All
Users\Documents\SmarTerm\Sessions\VISTA.stw""", 1)
Else
OutputFileName = Environ("APPDATA") & "\phi\gostring.rrt"
Set fs = CreateObject("Scripting.FileSystemObject")
Set File = fs.CreateTextFile(OutputFileName, True) <---------
File.WriteLine Replace(SSN, "-", "")
File.WriteLine MenuString
File.Close
MergeIntoFlyer "VISTAVersal"
End If
End Sub
The line with arrow next to it is where the debugger takes me when I get the
error.
Thanks
button is pushed. I have sucessfully merged the code into my database. The
button works when I am using it on my computer but I get a path not found
when running it on another computer in the office. If someone could help me
figure out why this is happening I would greatly appreciate it.
The code is as follows.
Private Sub cmdOpenVista_Click()
VistaOpen "~^FEE PATIENT INQUIRY - LOC", Nz(VetSSN, "")
End Sub
Here is the code for the sub routine.
Sub VistaOpen(MenuString As String, SSN As String)
Dim OutputFileName As String
Dim fs, File As Object
If IsBlank(MenuString) Then
Call Shell("C:\Program Files\Esker\SmarTerm\STOFFICE.exe """ &
"C:\Documents and Settings\All
Users\Documents\SmarTerm\Sessions\VISTA.stw""", 1)
Else
OutputFileName = Environ("APPDATA") & "\phi\gostring.rrt"
Set fs = CreateObject("Scripting.FileSystemObject")
Set File = fs.CreateTextFile(OutputFileName, True) <---------
File.WriteLine Replace(SSN, "-", "")
File.WriteLine MenuString
File.Close
MergeIntoFlyer "VISTAVersal"
End If
End Sub
The line with arrow next to it is where the debugger takes me when I get the
error.
Thanks