A2007...could not find the object '1'. Make sure exists....

8

8020

I have an A2003 dbase that has worked fine for years. When I open using
A2007 all seems ok except for one piece of code. A Form OnClose Event is
used to open another form.

DoCmd.OpenForm stDocName22, acNormal, acEdit

I now get the following error........"The Microsoft Office Access database
engine could not find the object '1'. Make sure it exists and that you spell
its name and the path correctly." I have both front and back ends inTrusted
Location. What is different in A2007 that would cause this? Any and all
assistance appreciated.
 
A

Arvin Meyer [MVP]

Just a guess, but try opening your form "stDocName22" in design view. Open
the property sheet and clear our any filters and Order By clauses.
 
8

8020

Thanks for the quick response Arvin, the Order By On Load was the only one
turned on. Unfortunately, switching it off has no affect. Any other thoughts?
 
A

Arvin Meyer [MVP]

The error message states that it can't find an object named "1". Since I
doubt you ever had such an object, you need to logically go through your
filters and select statements to see if there is something that is a value.
Another possibility besides persistent filters is combo boxes derived from
Lookup fields in your tables. Never use lookup fields because results like
this one happen sporadically, especially if you filter on the value see in
the lookup.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
8

8020

Thanks for your help Arvin; much appreciated. I'm not sure why this works
but, as you suggested I went back to basics on the bit of code that opens the
form. Rewrote it as shown below and it now works ok.

'DoCmd.OpenForm stDocName22, acNormal, acEdit 'A2007 error occurs here !!
DoCmd.OpenForm stDocName22, , , stLinkCriteria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top