View Full Version : Error on Quitting 2007 .ACCDE files
irishtyke 10-26-2007, 11:09 AM 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?
boblarson 10-26-2007, 11:13 AM 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?
irishtyke 10-26-2007, 12:16 PM 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.
boblarson 10-26-2007, 12:20 PM 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
irishtyke 10-26-2007, 12:58 PM 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?
irishtyke 10-26-2007, 01:05 PM 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!
boblarson 10-26-2007, 01:08 PM 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).
boblarson 10-26-2007, 01:13 PM 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:
strErr = "rst.MoveNext"
rst.MoveNext
strErr = "DoCmd.OpenForm "Test", acViewNormal"
DoCmd.OpenForm "Test", acViewNormal
irishtyke 03-24-2008, 11:40 AM 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:
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.
|
|