Acess database engine could not find the object '1'

G

Guest

A command button that opened a form in Acess 2003 will no longer work in
Acess 2007. This button is has VBA code in its event procdure. Other buttons
that use VBA do manage to open Queries. Code below

Private Sub RecordSearch_Click()
On Error GoTo Err_RecordSearch_Click

Dim stDocName As String

stDocName = "RecordSearch"
DoCmd.OpenForm stDocName, acNormal, acEdit

Exit_RecordSearch_Click:
Exit Sub

Err_RecordSearch_Click:
MsgBox Err.Description
Resume Exit_RecordSearch_Click
End Sub
 
A

Arvin Meyer [MVP]

That code is straight out of a Microsoft wizard. Try this:

1. Locate the form in question and open it from the database window.
2. Carefully check the form name including all the spaces (if any)
3. Check to see if it is opening behind any other objects.
 

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

Similar Threads


Top