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!

Error When Opening Form in MDE

Status
Not open for further replies.

mkallover

Programmer
Feb 6, 2008
88
US
I'm having two users test a new version of one of my databases and they are getting an error when they click a button to open a new form. The error is:

The expression On Click you entered as the event property setting produced the following error: The OpenForm action was canceled.
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The button has a simple piece of code on it:
Code:
Private Sub Command72_Click()

DoCmd.OpenForm "frmReqSearch", acNormal

End Sub

The users and I are all using Access 2007 but the database is being saved in 2003 format. Of course, it works just fine for me so I can't troubleshoot as well as I would like and Google isn't helping much.

Any thoughts?
 
Can you type out the name of the form exactly as it appears in the database window?



Travis

"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement!
 
Not sure what you mean but it is "frmReqSearch" most every place I look.
 
Ok. Try this on for size.

Code:
Private Sub Command72_Click()

Dim stLinkCriteria As String

DoCmd.OpenForm "frmReqSearch", acNormal, , stLinkCriteria

End Sub

Travis

"Why would I ever want to learn about programming when Micorsoft products would be able to handle even the simplest of tasks. Oh...wait a minute...something's wrong with that statement!
 
Ah, I figured it out. They were missing an ODBC connection that was necessary to connect to one of the SQL servers being queried.

Once I added that connection, everything was fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top