Thanks for feedback. Lack of talent and being self taught would be the main reasons for the 'peculiarities'!
I've amended the code following your guidance and seems to work well.
Thanks again.
Code:
Private Sub btnInsurance_Click()
'OPEN THE USER'S OWN UNIQUE FRONT END FOR THE INSURANCE DATABASE
'*** MINIMIZE CURRENT DATABASE (MSFront Database) to ensure the opening database (InsVB Front) is shown to the user ***
DoCmd.RunCommand acCmdAppMinimize
'*** SET VARIABLE FOR ACCESS APPLICATION ***
'Set variable name and type for Access application
Dim appAcc As Access.Application
'Set variable value (open a new version of Access)
Set appAcc = New Access.Application
'*** SET VARIABLES FOR PATHNAMES ***
'Set variable name and type
Dim strEmpName, strlaccdb, straccdb As String
'Set variable values
'Unique user name - Taken from user login name in Passwords form
strEmpName = Forms![frmpassword].Form![EmployeeName]
'Pathname of locked database location, i.e. the database is already open
strlaccdb = Dir("Z:\InsVB\InsVB User Front Ends\" & strEmpName & "\InsVB Front.laccdb")
'Pathname of database location
straccdb = ("Z:\InsVB\InsVB User Front Ends\" & strEmpName & "\InsVB Front.accdb")
'*** OPEN DATABASE IF NOT ALREADY OPEN ***
'If the pathname (file location) for the locked file has NOTHING in it then proceed and open the database
If strlaccdb = "" Then
'Make database visible
appAcc.Visible = True
'Locate and open other database
appAcc.OpenCurrentDatabase straccdb
'UserControl tells access how the database was opened
appAcc.UserControl = True
'Maximize other database
appAcc.RunCommand acCmdAppMaximize
'BUT if the pathname for the locked file has SOMETHING in it then do not open the database for a second time and tell user what is happening
Else
MsgBox "I think you already have the INSURANCE database open." & vbCrLf & vbCrLf & _
"Please check your task bar.", vbExclamation, "OPEN INSURANCE DATABASE"
End If
End Sub