AppActivate spontaneously stopped working

  • Thread starter Thread starter Vashfish
  • Start date Start date
V

Vashfish

I inherited a very convoluted system when I started working at my new
job. We have a database that uses AppActivate to switch between a few
different Access applications. The other day, my computer spontaneously
started giving me the error (even though everyone else's are working
properly):

Run-time error '5':

Invalid Procedure call or argument

Now, I've seen a few other posts like this but our situation is unique:
the code actually uses the failure of AppActivate to open the other MDB
files by using error checking:

-----------------
On Error GoTo Err_ActivateReportsButton_Click
AppActivate "Reports"
Exit_ActivateReportsButton_Click:
Exit Sub

Err_ActivateReportsButton_Click:
DoCmd.Hourglass True
'KV1Reports is not open, so open it
Set objReports = CreateObject("Access.Application")
strDBName = ApplicationPath & "KV1Reports.mdb"

objReports.OpenCurrentDatabase strDBName, False
objReports.Visible = True
objReports.UserControl = True
objReports.DoCmd.Maximize

DoCmd.Hourglass False
Resume Exit_ActivateReportsButton_Click
 
Back
Top