Hello All,
I have a Loader written by one of our old alumni, KenHigg.
The loader was originally written to Load a new Front-end into a local drive. Enter a new world where my Users are logging into a Remote Desktop with a shared C: Drive.
So the loader will be on the C: Drive, but the files it copies will be on the User\Drive.
I can verify the existence, and make directories, in the User Drive with the following code. This code runs from the On Load Event of the Display Form I added.
Once the form closes, it runs the Autoexec1 Macro that was previously named Autoexec, so it would open at launch. The Display Form loads now and then the macro Runs. As you can see. This Macro calls a Function
In the Module Constants are given a value.
Both of the following Codes Works:
These do not:
The get User Function is defined as:
Any Ideas?
I have a Loader written by one of our old alumni, KenHigg.
The loader was originally written to Load a new Front-end into a local drive. Enter a new world where my Users are logging into a Remote Desktop with a shared C: Drive.
So the loader will be on the C: Drive, but the files it copies will be on the User\Drive.
I can verify the existence, and make directories, in the User Drive with the following code. This code runs from the On Load Event of the Display Form I added.
Code:
Private Sub Form_Load()
Dim strExistinPath As String
On Error Resume Next
strExistinPath = "C:\Users\" & getComputerUser & "\TrecoraClient"
If Dir(strExistinPath, vbDirectory) = "" Then 'MkDir strDirectoryPath
MkDir strExistinPath
End If
DoCmd.RunMacro "autoexec1"
DoCmd.Close
End Sub
Once the form closes, it runs the Autoexec1 Macro that was previously named Autoexec, so it would open at launch. The Display Form loads now and then the macro Runs. As you can see. This Macro calls a Function
In the Module Constants are given a value.
Both of the following Codes Works:
Code:
'Const cstrClientFEPath = "C:\TrecoraClient\"
'Const cstrClientFEPath = "C:\Users\jsanders\TrecoraClient\"
These do not:
Code:
'Const cstrClientFEPath = "C:\Users\" & Environ("username") & "\TrecoraClient\"
Const cstrClientFEPath = "C:\Users\" & getComputerUser & "\TrecoraClient"
The get User Function is defined as:
Code:
Public Function getComputerUser()
pubComputerUser = Environ("username")
getComputerUser = pubComputerUser
End Function
Any Ideas?
Last edited: