The following function is in the front end of a database used by four people plus myself. We all share the same front end, so references, etc. are unchanged.
For all bar one of us, it works fine:
1. It checks if a file for a particular VIN is in a folder for a particular Dealer, which is in either the 'HDS' or 'iHDS" folder.
2. If it is present, the file is opened.
3. If it isn't present, a message is displayed to that effect.
For this one user, there is no error message but the final 'Sub folder not found' message is always displayed, regardless of whether or not a file is present.
So far, I've tried the following:
1. Confirmed that the user has access to the folder/files in question.
2. Added message boxes at each stage of the process, to verify that all strings hold the correct values
3. Restarted the database
4. Restarted his PC
5. Tested that this problem occurs when he's the only person logged in as well as when there are multiple users logged in
This is my first time using 'Shell'.
Does one of those people with more knowledge and experience than myself know if something needs to be present on a person's PC before that function will work?
Is there anything that stops it working?
For all bar one of us, it works fine:
1. It checks if a file for a particular VIN is in a folder for a particular Dealer, which is in either the 'HDS' or 'iHDS" folder.
2. If it is present, the file is opened.
3. If it isn't present, a message is displayed to that effect.
Code:
Private Sub btnHDS_Click()
Dim strFoldername As String
Dim strVIN As String
Dim strDealerCode As String
strDealerCode = Me!DEALER_CODE
strVIN = Nz(Me.VIN, "")
If strVIN = "" Then
strMsg = "No VIN was selected"
strTitle = "Process cancelled"
strResponse = MsgBox(strMsg, vbOKOnly, strTitle)
Exit Sub
End If
strFoldername = "R:\HDS" & "\" & strDealerCode & "\" & strVIN
If FolderExists(strFoldername) Then
Shell "C:\WINDOWS\explorer.exe """ & strFoldername & "", vbNormalFocus
Exit Sub
End If
strFoldername = ""
strFoldername = "R:\iHDS" & "\" & strDealerCode & "\" & strVIN
If FolderExists(strFoldername) Then
Shell "C:\WINDOWS\explorer.exe """ & strFoldername & "", vbNormalFocus
Exit Sub
End If
strMsg = "Sub folder '" & VIN & "' not found in either HDS or iHDS"
strTitle = "Process cancelled"
strResponse = MsgBox(strMsg, vbOKOnly, strTitle)
End Sub
For this one user, there is no error message but the final 'Sub folder not found' message is always displayed, regardless of whether or not a file is present.
So far, I've tried the following:
1. Confirmed that the user has access to the folder/files in question.
2. Added message boxes at each stage of the process, to verify that all strings hold the correct values
3. Restarted the database
4. Restarted his PC
5. Tested that this problem occurs when he's the only person logged in as well as when there are multiple users logged in
This is my first time using 'Shell'.
Does one of those people with more knowledge and experience than myself know if something needs to be present on a person's PC before that function will work?
Is there anything that stops it working?