Can't Open Form (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 03:16
Joined
Oct 30, 2008
Messages
1,257
I've re-arranged my drive letters and cannot run my database anymore!

It tells me "'E:\MyList\ListBE.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

This is correct as the Drive is now F:\.
However I cannot find where/why it is still looking for E:

There is an autoexec file which Opens Form1. In Form I code there's now a Stop in Both Form_Open and Form_Load events, but the error message comes up whenever Form1 is opened (without attempting either of these events). So what is it doing instead ?

How best might I approach fixing this? Thanks.
 

Micron

AWF VIP
Local time
Today, 11:16
Joined
Oct 20, 2018
Messages
3,478
Your post is not clear. What does "cannot run" mean? You can open it, yes? But you get an error message and the form doesn't open correctly? Or the form doesn't open at all but your code window opens up? What happens if you hold shift key when you try to open db?


Assuming you can open the db at all (and dismiss any errors) go to options and look there first - for anything that is looking in the old path, such as a db image file.
Check the macro for anything that involves the path. If nothing found in either of these places, go to the code (any module will do). Ctrl+F and enter "F:" to find. Be sure to include the whole project in the search.

My money is on a startup image file that can't be found (or maybe code tries to run and use the old drive letter).
 
Last edited:

kirkm

Registered User.
Local time
Tomorrow, 03:16
Joined
Oct 30, 2008
Messages
1,257
It's all very odd. I copied the front and backend files to another computer (win xp Office 2016) and they run ok. (This is Office 2019 and Win 10).
Next I copied them to another drive here and get the same error about drive E:


I can open the db with or without holding shift. It's the Form that won't open. I've deleted autoexec which was attempting to open the Form.


From the Navigation pane, when you Open A Form, what happens first ? As I say, a temporary Stop command is in Form Load and Form Open code, but it's not getting there before bringing up the error. Is that a clue?


There's nothing under Options that points to Drive E: Also that path does not show up searching the Project.
 

Micron

AWF VIP
Local time
Today, 11:16
Joined
Oct 20, 2018
Messages
3,478
I copied the front and backend files to another computer (win xp Office 2016) and they run ok
Because that computer still has a drive mapped to E and that's where you put the files?
From the Navigation pane, when you Open A Form, what happens first
Open event, then load event. More here...
As I say, a temporary Stop command is in Form Load and Form Open code
Open form in design view. Put a break on both events at the very first line (Private Sub...) and try to switch to form view. If code does start to run it should break at the first line; step through (F8 I think, but I always use toolbar) and see if you can raise the error. If you do, it should either reveal the problem or at least point to it.

If not, suggest you open the form in design view and check all controls that might have control sources that are expressions (such as DLookup or custom functions) that might involve E: . Also look in embedded macros if you have any because the Search in the code editor won't find those.
 
Last edited:

kirkm

Registered User.
Local time
Tomorrow, 03:16
Joined
Oct 30, 2008
Messages
1,257
You are quite right, the other comp had the correct files in E:.
I can't open the Form except in Design mode and a Stop there doesn't work.

I've been removing components in an attempt to locate the problem and may have found it.
A linked table ? Although I'd expect the dialog asking you to manually locate it. However it seems to be the only thing - there are many references under "Linked Table Manager" to the old E: path. I've never seen this before... I can select them individually. Will see what happens...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:16
Joined
May 7, 2009
Messages
19,233
you link the tables again.
on the Ribbon->External Data->Link Table Manager.
select all tables. Tick on "always prompt for new location".
 

kirkm

Registered User.
Local time
Tomorrow, 03:16
Joined
Oct 30, 2008
Messages
1,257
Thanks very much... have it all sorted. Even exported the list to Excel so can double check them all. Some show paths that haven't existed for years.
 

Micron

AWF VIP
Local time
Today, 11:16
Joined
Oct 20, 2018
Messages
3,478
Although I'd expect the dialog asking you to manually locate it
Nope, at least not if I recall correctly. Would you believe that was my next guess? I figured if you could open the form in design yet the break(s) did nothing, it had to be the form record source. Glad you figured it out.
 

kirkm

Registered User.
Local time
Tomorrow, 03:16
Joined
Oct 30, 2008
Messages
1,257
Thanks Micron... and I was foxed completely by it working on the other comp.
 

Users who are viewing this thread

Top Bottom