David92595
Registered User.
- Local time
- Today, 15:03
- Joined
- Jun 28, 2011
- Messages
- 44
Hello,
I am having problems opening up a windows shell to a file path in a Module Function. I have it working as a sub, but am trying to convert to a module so it can be centrally located.
I can get a basic explorer window to open
RetVal = Shell("explorer.exe ")
However, when I try to put in a file path with variables I start getting errors. I think my problem is defining the location of my variables. Particularly, LN (Loan Number) and Client_Name
Here is my code:
apath is a needed secondary variable. There are cases where I have to do some case specific changes to LN.
As Always, any help would be greatly apprechated.
Thank you,
David92595
I am having problems opening up a windows shell to a file path in a Module Function. I have it working as a sub, but am trying to convert to a module so it can be centrally located.
I can get a basic explorer window to open
RetVal = Shell("explorer.exe ")
However, when I try to put in a file path with variables I start getting errors. I think my problem is defining the location of my variables. Particularly, LN (Loan Number) and Client_Name
Here is my code:
Code:
Function Loan_Folder_Search2()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT LN FROM [Loan_Info_Local]")
Dim LN As String
LN = rs![LN]
Dim Client_Name As String
Client_Name = rs![Client_Name]
Dim RetVal As String
Dim LFPath As String
Dim aPath As String
aPath = LN
If Client_Name Like "Bank of David *" Then
LFPath = "\\MSERVER\MDefault\BOD\"
RetVal = Shell("explorer.exe " & LFPath & aPath, vbNormalFocus)
Else
MsgBox "Either Client Name is Unknown or Client does not have a loan folder for this LN#. Please Check to see if a Loan folder exists for this LN# or see your supervisor for directions."
End If
End Function
apath is a needed secondary variable. There are cases where I have to do some case specific changes to LN.
As Always, any help would be greatly apprechated.
Thank you,
David92595