I have spent countless hours on this and cannot find a solution. I am opening a Microsoft Access database from another MS database. When the second database opens, it minimizes on screen. No matter what I do, I can't seem to get the code in the first database to relinquish focus to the second database. Below is my calling code
Dim strPath As String
Dim accapp As Access.Application
strPath = CurrentProject.Path & "\EZPROHR.accde"
Set accapp = New Access.Application
accapp.Visible = True
accapp.Run "SetHRVariables", EZ.strSessionID, EZ.EmployeeID, EZ.SecurityLevel, Forms!switchboard!EmpAccess, Forms!switchboard!ClientAccess
Stop ' the stop is only here for troubleshooting. When the code gets to the Stop, the second database in on the screen with the focus
Exit Sub ' when the code exits the routine, then the second database minimizes to the task bar.
I have already tried running accapp.RunCommand acCmdAppMaximize from the calling application and
DoCmd.RunCommand acCmdAppMaximize on the second database when it launches.
I've tried docmd.maximize on a loading form in the second database and accapp.docmd.maximize from the calling app
I've tried using SendKeys "% X"
I've tried dozens of variations of coding on timer events of loading forms etc. Nothing has worked.