Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catch Error: "Could not find file 'M:\backend.mdb' 1

Status
Not open for further replies.

kramerica

Technical User
Jun 19, 2001
74
US
My database is Windows 2000. It has a front end and a back end. I have code to auto-relink the tables when they can't find each other and the code works.

Unfortunately when the database first opens it gives the error with the yellow exclamation "Could not find file 'M:\Backend.mdb'" then it opens up the form that auto-relinks the front-end to the backend.

I DON't want it to display the "Could not find file" msgbox. How do I trap this? Do I use a module? The error comes up before it runs my default startup form's 'On Load' code. I can determine if the error runs, because it does open my relink form automatically.. I just don't want to display the error.


 
Hi...

I can't answer you because i don't know the answer,but can you send me the code to auto-relink the tables when they can't find each other.

I have tried to write such a code but it doesn't work.

Bye...
I hope i will find the answer of your question...
 
Hi,

Do you know which error number is thrown? If so, you can trap the error by using the following code :

OnError goto ErrorHandling

---your code---

ExitMe:
DoCmd.Quit
Exit Sub

ErrorHandling:
If Err = number of the error Or Error = "description of the error" Then
exit sub
Else
Resume ExitMe
End If
MsgBox (Err & " - " & Error) 'Display the error
Resume ExitMe

Hope this helps...
Borg
 
The error code is 3024 and I capture it on the first form with the

On Error goto Errorchecker:

Errorchecker:

if err.number = 3024 then
' open form to relink tables.


The error routine - catches the code but unfortunately Access is still displaying the error msg BEFORE the error checking routine on the form even has a chance to run.

I can check the error and run the appropriate form based on the error, I just don't want to display the initial error when the database is first opened.
 
Where do you put the line : On Error goto Errorchecker ?
I put it right after form_load() and this seems to do the trick for me...

Regards
Borg
 
I fixed it .. my main menu had a field on it that was causing the error to come up before the "ON_LOAD" error checking code had a chance to run and catch it.

I fixed this by creating another startup form called AUTOEXEC and this form calls the "Main Menu" the error code is then trapped and it successfully executes the error routine to relink tables.

Thanks for the help everybody.
Kramerica
 
As a pointer it may be useful to relink the tables from the backend but using the network path instead on the network drive.

I have had problems in the past with windows 2000 dropping network drive connections when they have been idle for a length of time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top