An error occured while loading form... (1 Viewer)

Bilbo_Baggins_Esq

Registered User.
Local time
Yesterday, 22:02
Joined
Jul 5, 2007
Messages
586
Please read my post carefully.
I know the users below were genuinely trying to assist, but trust me, I ALREADY KNOW HOW TO FIX THE CAUSES OF THE ERROR.
The purpose of this thread is NOT to fix the causes, but to manage the ORIGINAL ACCESS error.


I have a database that is being opened programmatically with VBA in an Access.Application object

During the opening process, an error is fired, apparently by Access or DAO.
An error occurred while loading ‘Form_...
Do you want to continue loading the project?
Yes | No |Help
I cannot break into the code and appear unable to capture an error number from it.

If you answer NO, it just keeps firing until you click YES.

After you click YES, it does finally fire a VBA error which my error handler does pick up:
First I get:
29070 – Your Microsoft Access database or project contains a missing or broken reference to the file ‘MSCAL.OCX’ version 7.0
Then I get:
29063 – The Visual Basic for Applications project in the database is corrupt.
I have investigated this in more detail and apparently there is some real problem with the VBA module associated with the form mentioned in the original error.
I did some diagnostics to confirm this and am satisfied with my understanding of that.
If it were in my purview, I could very easily fix the problem with the module (and actually already have fixed it) and all these errors go away.

HOWEVER, (and this is what may seem odd to some here), it is not my purview to perform that service!
I am not concerned about what I learned to confirm there is a problem with the module.
My code is only opening the database to capture a few specific properties.
Since I am not the “owner” of to DB, it is not necessarily my place to perform any edits or make any changes.
My purpose is only to capture these few OTHER attributes and report the findings.
And yes, now that I have discovered the risk/opportunity to report back regarding possible Module corruption, I will add that to the other attributes I cheeck.
but still it remains, not the purpose of the tool to perform any remediation or edits or repair.

So, now my problem:
How can I handle that very original error?
If I can suppress it, or get past it, my VBA error handling should work just fine and even make note of the corruption error (even thought that was not necessarily part of my original quest).
To be clear, the two VBA Errors ARE NOT my challenge here.
The real problem is, I can’t find a way to programmatically manage that very first error from Access or DAO (suspect Access since it is caused by the VBA).

The error fires completely while inside either one of these two specific lines:
Code:
With AccessObj
    .Visible = False
    [COLOR="Red"].Application.ConvertAccessProject AccessPathIn, AccessPathOut, 12[/COLOR]
    .Application.DoCmd.Quit
End With
Or
Code:
With AccessObj
    .Visible = False
    .VBE.MainWindow.Visible = False
    [COLOR="red"].OpenCurrentDatabase AccessPathIn, True[/COLOR]
    .Application.DoCmd.Minimize
End With
Is there a way to turn off Access or DAO Errors without impacting VBA Error reporting?
Is there some tricky or sneaky way you guys might know to provide a “yes” answer to the dialog?
Programmatically, I see this is a problem because it never really gets out of either of those two lines while the error dialog is open?

As always, any help or tips or suggestions or hints will be deeply appreciated.
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Yesterday, 23:02
Joined
Jan 23, 2006
Messages
15,379
What version of Access are you using?

What do you have for error handling?
 

Bilbo_Baggins_Esq

Registered User.
Local time
Yesterday, 22:02
Joined
Jul 5, 2007
Messages
586
The code is running within Excel 2010 and when the Access Object is called, it opens with Access 2010.

i have just a normal On Error goto... setup

I then read the err.number and process accordingly with several If/Then statements.

HOWEVER, the point here is, I never hit that with the first error.
The very first, original error is not a VBA error, it is an Access or DAO error.

The code never leaves the red lines from those cited statements above.

Am i missing something about error handling here?
it doesn't seem like the VBA even sees this as an error until after YES is clicked.
 

Solo712

Registered User.
Local time
Yesterday, 23:02
Joined
Oct 19, 2012
Messages
828

jdraw

Super Moderator
Staff member
Local time
Yesterday, 23:02
Joined
Jan 23, 2006
Messages
15,379
Access 2010 deprecated features and components
by Access Team
on January 09

This post provides an overview of features and components that will be deprecated in the upcoming release of Access 2010. A decision to remove a feature or component from the product is never a trivial one; we therefore have put a lot of thought when deciding to remove functionality. We believe it will benefit the majority of our customers by helping us to make forward progress.

Microsoft recommends that when you develop new Access applications, upgrade or modify existing applications, avoid using and remove these deprecated features and components.

Here’s a list of deprecated features and some workarounds you can use. We would love to get your feedback and experience with the workarounds.


Calendar Control (mscal.ocx)

The calendar control is not shipped in Access 2010 for a number of reasons. If you open a form that has mscal.ocx and you will see the following error: “Your Microsoft Office Access database or project contains a missing or broken reference to the file 'MSCAL.OCX’.”

To fix this issue, you will need to remove this from your application. Here are some alternatives:

Use datepicker. Here is an example on the datepicker- http://office.microsoft.com/en-us/access/HA102835451033.aspx
Use other 3rd-party calendar controls that are available on the Web. Here are a couple of community provided calendar controls:


http://www.granite.ab.ca/access/calendars.htm
http://www.accessmvp.com/JConrad/accessjunkie/calendars.html
 

Bilbo_Baggins_Esq

Registered User.
Local time
Yesterday, 22:02
Joined
Jul 5, 2007
Messages
586
jdraw & solo712,

i really appreciate your effort and I am sure you sincerely intend to help me.
Please sir, read my original post
I know all about the deprecated features and mscomct2.ocx, and I already stated i know about the module corruption.
But, I'm pretty sure I already articulated the VBA errors are not a concern here.

Please sir, you are effectively driving this thread off course with this path you are taking.
I know full well why the original error is firing and as I stated in my original post, I already know how to fix those problems.

Remediating those challenges is not my issue and not may place.
Therefore, the VBA error are not the challenge here.

My challenge, which has now been driven way off course, is how to manage the original ACCESS ERROR programmatically.

Not to sound too repetitive here, but I already know exactly why the errors are firing and exactly how to fix them.
However, fixing the, is not the purpose of this thread.

I need to be able to manage the original Access error programmatically and the original error is NOT a VBA ERROR.
 
Last edited:

Bilbo_Baggins_Esq

Registered User.
Local time
Yesterday, 22:02
Joined
Jul 5, 2007
Messages
586
sigh....

PLEASE, read my post.
I do not need to fix the problems.
Even if I did, I ALREADY KNOW HOW TO FIX THEM.

I even mentioned:
(and this is what may seem odd to some here)

Sigh, I really need to get help to MANAGE THE ERROR, NOT FIX THE CAUSE OF IT.
Now this thread is way off base…
 

Users who are viewing this thread

Top Bottom