The database ran fine with XP/Access 2002, iffy with Windows 10/Access 2003. References look ok. All the main objects remain at the same C:/… addresses. As far as possible, I’d like Access to look for anything it wants, in the same folder as the front and back ends and the photo folders.
Autoexec says RunCode (GetDBPath() pasted below) and then OpenForm (frmMainMenu). MsgBox “There is no object in this control” occurs twice before frmMainMenu opens. It looks normal, but the photo-linked-to-record display doesn’t work properly. The tables look fine.
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 'line added DB
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() 'MyDB now means "this database"
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" 'Tracking DB
End Function
btw ... if there's anything annoying about this post (Not here! Too long! Why didn't you ...!) please say so.