execution of this application has stopped due to a run-time error (1 Viewer)

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
Hi All,

Most of our users now have to use Access runtime instead of the full Office package

When the users open the DB, they get a " execution of this application has stopped due to a run-time error"

I have narrowed it down and comes from the code below


Any suggestion on how to remedy this please
Option Compare Database
Option Explicit

Private Sub Form_Current()

DoCmd.NavigateTo ("acNavigationCategoryObjectType")
DoCmd.RunCommand (acCmdWindowHide)
DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:09
Joined
May 7, 2009
Messages
19,169
does the runtime have the Navigation pane? or the Ribbon?

you can also check if the db is using runtime:

if syscmd(acSysCmdRuntime) then
...
end if
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
does the runtime have the Navigation pane? or the Ribbon?
Hi Arnelgp

No, They do not need it, I hide it

also in my options I disable: displays document tabs
disable display navigation pane
and I do not allow full menus
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:09
Joined
May 7, 2009
Messages
19,169
comment those lines and see what happens?
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
comment those lines and see what happens?
I did, seems to work for the sign on screen
now other forms are giving the same error, still in the process to figure out what the cause is
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:09
Joined
Sep 21, 2011
Messages
14,041
Look at the event viewer to see if you can get the error number?
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:09
Joined
Sep 21, 2011
Messages
14,041
How do I look at the event viewer in runtime?
Just look at the Event Viewer. It should have an entry for Access if it stopped abnormally.?
It would have to be on runtime machine as well.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:09
Joined
May 7, 2009
Messages
19,169
maybe all your Forms/Report has Same code.
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
I saved the DB as Make ACCDE and it seems to work on the runtime pc
Obvious this is not the solution

Any ideas why this worked?
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
Just look at the Event Viewer. It should have an entry for Access if it stopped abnormally.?
It would have to be on runtime machine as well.
Dont see any runtime entries in the event viewer
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:09
Joined
Sep 21, 2011
Messages
14,041
They should only have an accde file in the first place????
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:09
Joined
Sep 21, 2011
Messages
14,041
Dont see any runtime entries in the event viewer
Worth a try. I am surprised at that, as it shows tons of info.:( and I would say an app stopping abnormally is an event. :)
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
They should only have an accde file in the first place????
The file they use is an ACCDE file

The Make ACCED saves into a compiled executable only file, that is what I meant by ACCDE which worked, so not sure what the issue could be
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:09
Joined
Sep 12, 2006
Messages
15,613
if users have runtime they won't be able to open the dbs window
this sort of thing will handle the error, and not crash the programme - and let you assess the problem.
You can then decide whether you can continue, and change the fail handlers to suit
You can change your own file name to run it as runtime to test. I think it's .accdr

Are you sure "acNavigationCategoryObjectType" needs to be in quotes?

Code:
Option Compare Database
Option Explicit

Private Sub Form_Current()

       on error goto fail1
       DoCmd.NavigateTo ("acNavigationCategoryObjectType")

       on error goto fail2
      DoCmd.RunCommand (acCmdWindowHide)

     on error goto fail3
     DoCmd.ShowToolbar "Ribbon", acToolbarNo

     exithere:
     exit sub

fail1:
     msgbox "Fail1: Error " & err & "  Desc: " & err.description"
     resume exithere

fail2:
     msgbox "Fail2: Error " & err & "  Desc: " & err.description"
     resume exithere

fail3:
     msgbox "Fail3: Error " & err & "  Desc: " & err.description"
     resume exithere

End Sub
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
Dont see any runtime entries in the event viewer
I do get a repeatedly error on Netwtw06

I have a few other DB's and they all seem to work just fine except for this specific DB which is giving all the problems
 

Gismo

Registered User.
Local time
Today, 15:09
Joined
Jun 12, 2017
Messages
1,298
if users have runtime they won't be able to open the dbs window
this sort of thing will handle the error, and not crash the programme - and let you assess the problem.
You can then decide whether you can continue, and change the fail handlers to suit
You can change your own file name to run it as runtime to test. I think it's .accdr

Are you sure "acNavigationCategoryObjectType" needs to be in quotes?

Code:
Option Compare Database
Option Explicit

Private Sub Form_Current()

       on error goto fail1
       DoCmd.NavigateTo ("acNavigationCategoryObjectType")

       on error goto fail2
      DoCmd.RunCommand (acCmdWindowHide)

     on error goto fail3
     DoCmd.ShowToolbar "Ribbon", acToolbarNo

     exithere:
     exit sub

fail1:
     msgbox "Fail1: Error " & err & "  Desc: " & err.description"
     resume exithere

fail2:
     msgbox "Fail2: Error " & err & "  Desc: " & err.description"
     resume exithere

fail3:
     msgbox "Fail3: Error " & err & "  Desc: " & err.description"
     resume exithere

End Sub
Even when I remove the " " from "acNavigationCategoryObjectType", I still get the error
when I remove it, I get past the sign on screen to the menu page

If not in " " then I get a not defined error

Also, below gives an compile error

msgbox "Fail1: Error " & err & " Desc: " & err.description"
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:09
Joined
Sep 12, 2006
Messages
15,613
What description do you get for the error? (with the quotes)

I found this

vba - Is the MS-Access Navigation Pane visible? - Stack Overflow

if it's to do with the navigation pane, then it just can't be open in a run time - so maybe just use the fail1 to resume at the next test, or even the show ribbon process.

This is probably a time when you could have on error resume next until you get to the show ribbon. You may even get an error with the ribbon in the run time.
 

Users who are viewing this thread

Top Bottom