Maybe the owner of the stored procedure is not dbo?
The recommended method is to create a form with the stored procedure as record source. Same with openview, opentable etc.
Main Topics
Browse All TopicsIn an Access database project form I have this little piece of code
DoCmd.SetWarnings False
DoCmd.Close acForm, "View_Edit_Tree"
DoCmd.SetWarnings True
DoEvents
DoCmd.OpenStoredProcedure "dbo.sp_Search_All"
DoCmd.Maximize
And at runtime the following error is returned "can't find the object 'dbo.sp_Search_All' ", error number 7874
The stored procedure exists in the database and expects one parameter.
Can you tell me why it doesn't see/execute it?
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
miral13,
You failed to respond to 2 Expert comments, either of which provided alternatives to your current issue (and vadimrapp1's comment was most likely your answer).
Did you solve this issue? If so, then please post your solution.
Did you attempt to close this question so that you could avoid the account lockout policy in regards to abandoned questions? I see that you've posted a new question just today.
He refreshed the database view in Access, so Access learned about new view that was created outside of it in the database.
Sometimes people resolve their own questions by hitting F5, scrolling down the page to see what was down there, restarting the computer, etc. - works better than all us experts combined, once they finally get themselves together to do it (after posting the question and having some discussion).
<works better than all us experts combined>
How true!
miral13, glad you reached a solution but in the future please post a short comment if you're deleteing your question, and please respond to Expert comments, even if it's to say that you've solved the issue.
IMO you should PAQ this question by accepting your own answer here: http:#25512766. This would be something that someone else might be able to use one day. If you PAQ and accept your own comment, your points will be refunded to you.
If you'd like to do that, then click the Object button, and then choose your own solution as the Answer and enter something like "found my own solution" in the Reason. This will close out the question in a few days, and keep that question in the PAQ.
Business Accounts
Answer for Membership
by: LSMConsultingPosted on 2009-07-10 at 06:55:18ID: 24823280
I'm not sure you can pass parameters with the DoCmd method ... but I don't know, as I've never opened SPs in this manner. I typically use a simple Recordset object, or a Command object:
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
With cmd
Set .ActiveConnection = CurrentProject.Connection
.CommandText = "dbo.sp_SearchAll"
.CommandType = adCmdStoredProc
.Parameters.Refresh
.Parameters(0).Value = "Your Value Here"
.Execute
Set .ActiveConnection = Nothing
End With
Set cmd = Nothing