Solved

When an error occurs on form load, how do I resume opening after fixing the error?

Posted on 2006-11-14
6
188 Views
Last Modified: 2012-06-21
When my form loads, it does some tLookups to retrieve settings. If the database is missing, renamed, etc., an error occurs. At this point I let the user reconnect to the database. Now I want to resume loading the form again, but it stays stalled wherever the error occurred.  If the error occurred on the open event I could do cancel = true, but that isn't where the error occurrs.  In fact, it doesn't appear to really occur in any procedure so I had to trap on the form's error event.

I've tried to close the form by using a function to close it before reconnecting the tables, but it crashes Access.

The Errors that trigger this relinking action are:
3024, 3043, 3044, 3151, 3146, 3078


0
Comment
Question by:HKComputer
6 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17938719
Have u tried issuing

Resume Next

or create a label and perform a Goto to that label when u capture the error?
0
 
LVL 4

Author Comment

by:HKComputer
ID: 17938826
I tried resume next and it didn't work.

I didn't try the label but I did try sending it back to Form_Load.


I think I may have found a solution now. I'm starting a different form first that is not bound to any of my backend databases. It then performs some tLookups to the backends. If errors occur, everything get's reconnected and then my main form comes up.

The problem is that starting a form bound to a non-existant database makes an "almost" untrappable error occur sometime while the form is opening. And worse yet, it stops all execution of the forms code and you cannot restart it. And as if that isn't bad enough, none of your error handling procedures are allowed to close this form and reopen it because this form called the error procedure, so technically, it is still in the middle of code execution when you try to close it. And that crashes Access.

Oh, the things you learn.
0
 
LVL 4

Author Comment

by:HKComputer
ID: 18229978
Please close and refund. The solution I listed above worked for me. Thanks -HK
0
 
LVL 61

Expert Comment

by:mbizup
ID: 18229995
Got it, HK :-) ... that's what the PAQ-refund recommendation means.  Please take a look at your other open questions.

Thanks in advance,

mbizup
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18260690
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question