Error on Quitting 2007 .ACCDE files

irishtyke

Registered User.
Local time
Today, 17:22
Joined
Jun 24, 2007
Messages
23
I am using the free trial version of Access 2007 and it seems to do all I need. However, I have a glitch that I cannot bottom out. When I quit Access from a .ACCDB file there is no problem, but when I convert the same file to a .ACCDE and quit Access, I receive a message "The property you entered on load .....".

This error shows whether I quit via a cmd button or by the top-right X.

Does anyone have any ideas please?
 
Can you post the entire error message? Also, do you have any code in the displayed form's On Current event or On Unload event?
 
Error Quitting A2007 Runtime ACCDE

Can you post the entire error message? Also, do you have any code in the displayed form's On Current event or On Unload event?

Hi Bob,

Many thanks for the prompt response.

The entire error message is as follows:

"The expression On Load you entered as the event property setting produced the following error: There was a problem referencing a property or method of an object."

I believe the error arises when the application is trying to close the final form, where the On Load routine is as follows:

Private Sub Form_Load()

DoCmd.RunCommand acCmdAppRestore 'Resets application window size
DoCmd.Maximize 'Maximizes form within application window
'
'Code to hide windows in taskbar and ensure Hidden Objects are hidden
Application.SetOption "ShowWindowsinTaskbar", False
Application.SetOption "Show Hidden Objects", False

End Sub

Although this all works fine in A2K and A2K3 (both MDB & MDE), and it works fine in A2K7 ACCDB, the error always shows when quitting A2K7 ACCDE.

Is this a command incompatibility problem?

Many thanks.
 
It could be, as it might treat setting application options via code as design changes where they apparently weren't before.

I would try removing these lines and see if it doesn't give the error again in A2K7 ACCDE.

Application.SetOption "ShowWindowsinTaskbar", False
Application.SetOption "Show Hidden Objects", False
 
No Progress Yet

I tried the routine again with all 4 command lines bypassed but still received the same message.

Am I right to assume that the error is in the Form_Load() procedure and that, because it remains visible at the back of the error message, I am looking at the correct form?
 
Given that this error arises whether the application is being quit from VB or by the top-right X, I am assuming that the sequence is the same, presumably to close all forms before closing the application. I've tried replacing the DoCmd.quit line with DoCmd.Close to see if I could trap it, but no error shows except in the ACCDE file anyhow, which cannot be debugged.

Puzzled!
 
I tried the routine again with all 4 command lines bypassed but still received the same message.

Am I right to assume that the error is in the Form_Load() procedure and that, because it remains visible at the back of the error message, I am looking at the correct form?

Not necessarily. It can be a bear sometimes to troubleshoot errors, especially when your MDE file seems to work differently than an MDB file. The first thing that would come to mind is anything that could be considered a design change because MDE's won't let you do those (except queries and tables).
 
which cannot be debugged.
It can sort of, but it is a pain. I had a situation where I was getting an error in my MDE file upon opening and because I had error handling which identified the process on most of my important events, I was able to track it down to a specific procedure. So, then I created a special error handler where I assigned the next line of code to a text string so that if that next piece of code errored out it would display the message which told me which line of code caused the problem. There might be easier ways of doing that one.

Anyway, I then was able to see exactly which line of code was causing me problems and I could fix it.

So, to illustrate, if I had a line of code in that procedure that read:

rst.MoveNext
DoCmd.OpenForm "Test", acViewNormal

Then my code would look like this:
Code:
strErr = "rst.MoveNext"
rst.MoveNext
strErr = "DoCmd.OpenForm "Test", acViewNormal"
DoCmd.OpenForm "Test", acViewNormal
 
Error Quitting A2K7 Runtime

It can sort of, but it is a pain. I had a situation where I was getting an error in my MDE file upon opening and because I had error handling which identified the process on most of my important events, I was able to track it down to a specific procedure. So, then I created a special error handler where I assigned the next line of code to a text string so that if that next piece of code errored out it would display the message which told me which line of code caused the problem. There might be easier ways of doing that one.

Anyway, I then was able to see exactly which line of code was causing me problems and I could fix it.

So, to illustrate, if I had a line of code in that procedure that read:

rst.MoveNext
DoCmd.OpenForm "Test", acViewNormal

Then my code would look like this:
Code:
strErr = "rst.MoveNext"
rst.MoveNext
strErr = "DoCmd.OpenForm "Test", acViewNormal"
DoCmd.OpenForm "Test", acViewNormal
*********************************************

Hi Bob,

Many thanks for the response and apologies for the delay.

I need to find out why I am no longer receiving emails when someone responds in my subscribed threads.

Keep smiling.
 

Users who are viewing this thread

Back
Top Bottom