?
Solved

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

Posted on 2006-11-14
6
Medium Priority
?
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 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