I am using the "folderexists" function to determine the location of the backend.
This is followed by tableDef functions to relink the database with the backend.
the folderExists function is a custom function I found on google, and it works but makes start up incredibly delayed.
I was wandering if there was a quicker way to find where the backend resides but to also set the branch location and hence set the relevant variables
I was looking into error handling, but it seems to only handle a 2 case scenario, I would need 3 cases (one for each branch) and a final error message.
This is followed by tableDef functions to relink the database with the backend.
the folderExists function is a custom function I found on google, and it works but makes start up incredibly delayed.
Code:
If FolderExists("\\Bath\####") Then
Branch = "Bath"
'ElseIf FolderExists("\\CHIPP-NAS\####") Then
Branch = "Chippenham"
ElseIf FolderExists("\\NAS\####") Then
Branch = "Trowbridge"
Else
MsgBox "Your backend directory could not be found. Please restart the system. If this message continues to appear, please call for assistance", vbExclamation, "Directory Error"
End If
If Branch = "Bath" Then
ImgPath = "####\images\"
BePath = "####\BackEnd\"
InvoiceRef = "DPBA"
BranchhID = 1
If Branch = "Chippenham" Then ...
I was wandering if there was a quicker way to find where the backend resides but to also set the branch location and hence set the relevant variables
I was looking into error handling, but it seems to only handle a 2 case scenario, I would need 3 cases (one for each branch) and a final error message.
Code:
Function FolderExists(strPath As String) As Boolean
On Error Resume Next
FolderExists = ((GetAttr(strPath) And vbDirectory) = vbDirectory)
End Function