Of course, if you restore the old name all is Ok again. As far as I can think, that is a message from the database engine JET??? The question is: can be intercepted in order to run code to handle this error? Thank you for interest, Smiley! In my tests this error message is only triggered when an access is attempted to one of the linked tables.
I suspect you have something running automatically that includes such an access. You should try checking this as a first step in your code. Im unsure as to whether the exact error message can be trapped. There are 2 situations here to consider, the one your describing where you rename the backend can be handled by this: You need a startup form that does NOT bind to a recordset because if it does, access will try to load it, causing said error that runs the following code: Expand Select Wrap Line Numbers.
Quit 'Or whatever you want end If. Smiley: I have a similar problem, which the above would not solve, namely that when users go to lunch their computers go in standby mode and apparntly so does their network adaptor im guessing and when they return they get said error message or something similar and have to restart the tool.
Why not post on that and we can look at possible ways of getting around it. I suffer from that too sometimes and it may be worth spending some time designing a professional way to handle it Even if it's only to warn the user in a friendly way and ensure that the database is re-opened.
Not in this thread though of course ;-. Thank you, both, for answers. Yes: the start up form is bind to a table. I'll try Smiley code and I return here to inform you about results. Thank you again! In that case make your startup form a separate, unbound, form that does the checks and immediately opens the original form if, and only if, everything is ok.
Otherwise it handles whatever you need at that point. Hi, again. Every time I receive code from you, I can use it with no modifications. So I am pretty sure that your code is correct and functional. How can I do this? Answer: You can test to see if a directory exists using the VBA code below:. While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy. Home MS Access Functions. Fionnuala Fionnuala Hi Remou, thanks for you reply. If you look at the function, you will find that the path is stored in sPath and the file name is returned by Filename.
Okay, that I will admit to, just change it to object, but that declaration was not part of the original sample. Are you using the code I posted or did you make changes? Show 3 more comments. HansUp HansUp Clear FD. Vlado Vlado 5 5 silver badges 15 15 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. You can use the Path property to determine the location of information stored through the CurrentProject or CodeProject objects of a project or database. The following example displays a message indicating the disk location of the current Access project or database.
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
0コメント