Autoexec RunCode GetDBPath() stops with the word Mid (in red below) highlighted. Curable by unticking Microsoft Office Web Components in References - but after that, database can't find the named photo folders. Yet, in XP, that unticking isn't needed, and doing it doesn't seem have any affect - it continues to run fine. Might re-written code solve this? Or are the photo folders probably "lost" for some other reason?
Option Compare Database
Option Explicit
Public strDBPath As String
Public strPhotoDir1 As String
Public strPhotoDir2 As String
Public strPhotoDir3 As String
Public strPhotoDir4 As String
Public strGraphicDir As String
Public intFormHeight As Integer
Public intFormWidth As Integer
Function GetDBPath()
Dim MyDB As Database
Dim intTitleLength, intDBLength, intCount As Integer
Set MyDB = CurrentDb()
intDBLength = Len(MyDB.Name)
For intCount = intDBLength To 1 Step -1
If Mid(MyDB.Name, intCount, 1) = "" Then
Exit For
End If
Next
intTitleLength = intDBLength - intCount
strDBPath = Left(MyDB.Name, Len(MyDB.Name) - intTitleLength)
strPhotoDir1 = strDBPath & "dbase photos1"
strPhotoDir2 = strDBPath & "dbase photos2"
strPhotoDir3 = strDBPath & "dbase photos3"
strPhotoDir4 = strDBPath & "dbase photos4" ' line added DB
strGraphicDir = strDBPath & "dbase graphics"
'MsgBox "Autogenerated paths:@Database: " & strDBPath & "@Photos: " & strPhotoDir4
Debug.Print "Exit Basinitialise"
End Function